Go Down

Topic: [Solved]OLED display hat for pi connection with arduino (Read 469 times) previous topic - next topic

casual_controller


PaulRB

Quote
I have tried to connect the 2 arduinos together
That would only work if you uploaded a sketch to the second arduino to make it behave as an i2c slave.
Quote
having issues if the device you are trying to communicate with is not on the same voltage level
That could be the problem, yes. You could try connecting the pull-up resistors to 5V, but it could in theory damage the display, so do it at your own risk. Otherwise you could try an i2c level converter module. I've connected similar displays to 5V arduino before with no problem. In think my displays have a regulator built in, so can be powered by 5V, yours may not because it sold for use with pi, which is 3.3V. But I'm pretty sure my modules don't have built-in level converters, and they have always worked fine with 5V arduino and 3.3V arduino.

casual_controller

That would only work if you uploaded a sketch to the second arduino to make it behave as an i2c slave.That could be the problem, yes.
You could try connecting the pull-up resistors to 5V, but it could in theory damage the display, so do it at your own risk. Otherwise you could try an i2c level converter module. I've connected similar displays to 5V arduino before with no problem. In think my displays have a regulator built in, so can be powered by 5V, yours may not because it sold for use with pi, which is 3.3V. But I'm pretty sure my modules don't have built-in level converters, and they have always worked fine with 5V arduino and 3.3V arduino.
I definitely am going to try the 5V if I can't get it working, but I think step 1 is to get the I2C working? Maybe I'll try it anyway though

Even with the slave sketch on the arduino nano, the mega still doesnt find a device with the i2 scanner. There is also no output from the serial monitor on either the mega or the nano.

PaulRB

Even with the slave sketch on the arduino nano, the mega still doesnt find a device with the i2 scanner. There is also no output from the serial monitor on either the mega or the nano.
If there is no serial output, how do you know the mega is not finding a device?

casual_controller

UPDATE

I managed to get some more time for this project. I tried a couple more things (not worth mentioning)

I then went back and reread the datasheets and it turns out the default is SPI and not I2C

So after rewiring and using the correct library Adafruit_SH1106 with the display as SPI (from example sketch) everything is working!!!!!

I consider this one solved :D !

Much thanks @PaulRB for the assistance

Go Up