Expensive Notes
Well-known member
The default value for I2Cspeed below is 400000. I would like to speed up the communication between the Teensy and the screen so display.display(); is faster. It defaults to 400000Hz. In my code using this setting it takes 28ms to update the display. I tried using 1000000 as below and got 12ms, which is a lot better.
Is there a maximum safe speed for wire2?
Is there a maximum safe speed for wire2?
Code:
//--- Oled Screen ------------------------------------------------------------------- Oled Screen
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET 4 // Reset pin #
#define SCREEN_ADDRESS 0x3C // Found using scanner
#define I2Cspeed 1000000
//Initialize OLED screen. Changed Wire to Wire2 for SCL2 and SDA2
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire2, OLED_RESET, I2Cspeed);