adafruit / Adafruit-SSD1331-OLED-Driver-Library-for-Arduino

For 0.96" OLEDs in the Adafruit shop
http://www.adafruit.com/products/684
Other
101 stars 67 forks source link

Display corruption when multiple SPI_MODE devices used #14

Closed cscashby closed 6 years ago

cscashby commented 6 years ago

This is the same problem as defined in this issue for SSD1306.

When using multiple devices with mixed SPI modes - such as an SSD1306 and an HX8357, the SPI_MODE does not get reset if the SSD1306 is updated.

This can be fixed (as per SSD1306) by adding the following line in the Adafruit_SSD1331::spiwrite(uint8_t c) function:

SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE3));

Just before the call to SPI.transfer(c);

(note unlike the SSD1306 the library uses MODE3 not MODE0)

ladyada commented 6 years ago

hiya i think we fixed this in the "spitft" branch - can you try that and let me know?