Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on raspbery pi #8

Open
texrg opened this issue Mar 1, 2017 · 7 comments
Open

error on raspbery pi #8

texrg opened this issue Mar 1, 2017 · 7 comments

Comments

@texrg
Copy link

texrg commented Mar 1, 2017

Hello,
I use 128x32 on Raspberry Pi , i get this error:

var/lib/gems/2.1.0/gems/SSD1306-0.6.1/lib/SSD1306/display.rb:144:in pack': no implicit conversion of nil into Integer (TypeError) from /var/lib/gems/2.1.0/gems/SSD1306-0.6.1/lib/SSD1306/display.rb:144:in display!'

I install without any error

gem install SSD1306

Fetching: SSD1306-0.6.1.gem (100%)
Successfully installed SSD1306-0.6.1
Parsing documentation for SSD1306-0.6.1
Installing ri documentation for SSD1306-0.6.1
Done installing documentation for SSD1306 after 17 seconds
1 gem installed

@zeiv
Copy link
Owner

zeiv commented Mar 1, 2017

Hey texrg, do you think you could post your code? Are you creating a new display object with a height of 30?

At a quick glance it seems that this error is being caused because the library expects display heights to be in multiples of 8. I have the 128x64. My thought was the only other option was 128x32, right?

In any case, try setting your height to 32. If your display is actually 30 pixels tall, you might end up having your text cut off a tiny bit, but using 32 as the height should fix the error.

Alternatively you could set the height to 24, but then you would have 6 unusable rows.

@texrg
Copy link
Author

texrg commented Mar 3, 2017

128x32 my small mistake

@zeiv
Copy link
Owner

zeiv commented Mar 6, 2017

Did that fix the problem for you?

@texrg
Copy link
Author

texrg commented Mar 7, 2017

no

@zeiv
Copy link
Owner

zeiv commented Mar 13, 2017

Shoot. Can you tell me anything more about the error, or provide a code snippet?

@eflukx
Copy link

eflukx commented Aug 18, 2017

Encountered the same issue. When the height is set to 32 (maybe anything not 64 ?) this happens when initializing the display object. I encountered it when playing around, didn't bother to fix it as I have a 128x64 display.

@paichi81
Copy link

I use 128x32 OLED. font_size 2 is OK.

disp.font_size=2 
disp.println "HOGE" # OK
disp.font_size = 1 # BAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants