Ok, i programmed a wordclock which drives 23 ledstrips to show the time in words.
It works fine with a SSD1306 Oled but i have quite a few SH1106 Oled’s, i like to use.
With the SH1106 it works fine UNTIL i read a value of an LDR attached to one of the Analog ports (i tried all with no result) AND/OR i write a calculated value from that value to adjust the light-intensity of the LED-strips with PWM… I also tried several PWM outputs without result.
The clock runs for 2 to 10 seconds and then freezes…
The sketch uses about 11k bytes program storage and about 500 bytes dynamic memory on my Arduino Uno.
The LEDstrips are driven through 3 shifregisters (74595N) and 3 drivers (ULN2803). Time comes from a I2C-DS3231, three switches to set time and brightness, a I2C-Oled, LDR/resistor.
What can cause this crashes? i did include some delays to see if it was a timing issue, but also no improvement…
When i uncomment <// analogWrite(PWM_PIN,PWM);> in the LDR_Brightness(void) subroutine, it is a matter of seconds…
Anyway this is my sketch: (some, but not all words are in Dutch )
WC1106.ino (10.1 KB)