-
Notifications
You must be signed in to change notification settings - Fork 201
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
SPI not declared by package machine #151
Comments
Hello, which command are you using to build? Looks like the target is missing. |
Hi. I have an Arduino Nano, so I use Maybe I have some problems with GOPATH... |
Unfortunately, SPI support is missing for the Nano :( |
Oh, sorry for my incompetence. I try to connect to my display with I2C.
|
Oh, right. The drivers works for I²C and SPI, but it need both declared to work properly. Not sure if using some build tags we could split the driver in two and only load the version needed. Other solution is creating SSD1306SPI and SSD1306I2C drivers, but I prefer not to /cc @aykevl |
Ok, thank you :) Try to use another way :/ |
I'm re-opening this issue, thanks for bringing this up. This is a problem with the driver and should get fixed or at least propose an alternative, I think some other drivers also have I2C+SPi versions and there are other boards with only SPI or I2C support. For the moment, you could remove the references to SPI from the driver and it should work. |
So, I removed SPI parts, as you say, and it works great. Actually I see only two solutions to the problem:
|
Longer term, I think the best solution would be to create
|
Hi @ArtemkaKun just out of curiosity did you get the display to work after removing the SPI calls? I've been trying for a while with a 128x64 SSD1306 and all I get is a garbled display. |
Hi. Actually I only achieved compilation without errors :/ I don't test if the display can show something. Give me a sec. |
@TinHead can you show your code? |
yup you can use my fork here: https://github.com/TinHead/drivers |
Hi,
I have an SSD1306 OLED 128x32 display. When I try to use an example from SSD1306 driver and build, have 2 errors:
../../../../root/go/src/tinygo.org/x/drivers/ssd1306/ssd1306.go:38:19: SPI not declared by package machine \n ../../../../root/go/src/tinygo.org/x/drivers/ssd1306/ssd1306.go:63:25: SPI not declared by package machine
Any thoughts on what can be wrong? SPI type actually declared in machine package :/
The text was updated successfully, but these errors were encountered: