![]() ![]() Option 1: use any pins but a little slower #define MOSI_PIN 3 // on the hardware SPI pins as per the text below #define SCLK_PIN 2 // not using this as I've got it setup #define SCREEN_HEIGHT 128 // Change this to 96 for 1.27" OLED. I've been staring at all kinds of forum posts about using SPI and I2C simultaneously but I haven't really found any with a straightforward solution or they use a very different board. When I block out the sensor read and swap in the joystick reads it works fine again. When I try and build in the I2C example code into my code for the display, the moment I include to the code to read the values from the accelerometer, the program runs setup and then goes blank after that. When I run example code for the accelerometer I can see it outputting data to the serial monitor, and when I run my code for the screen using a joystick as test input it graphs the values nicely. ![]() I'm trying to stream the data coming from my I2C MMA8452Q accelerometer to an Adafruit-based SSD1351 OLED RGB display that uses SPI via an Arduino UNO. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |