Hello everyone,
I just had a strange problem with the adafruit I2C OLED module.
I reduced the code to the following:
The interesting part is, that the same code on the same board with the same circuit stops after 1 to 5 cycles. But why?
Everything this code should do is let the LED blink and print a increasing number on the OLED display.
After counting a couple of cycles (random between 1 and 5) it seams like the Teensy 3.1 got stuck. The OLED display shows the last number and the LED stays in the state it has.
Is there a problem in the lib, in the code, or is it just to late at night
I just had a strange problem with the adafruit I2C OLED module.
I reduced the code to the following:
Code:
#include "I2Cdev.h"
#include "MPU6050.h"
#include "Wire.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 9
Adafruit_SSD1306 display(OLED_RESET);
#define LED_PIN 13
bool blinkState = false;
int counter = 0;
void setup() {
pinMode(LED_PIN, OUTPUT);
// initialize communication
Wire.begin();
Serial.begin(38400);
// initialize OLED
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
// display text
display.setCursor(0,0);
display.print("working...");
display.display();
}
void loop() {
// blink LED to indicate activity
digitalWrite(LED_PIN, blinkState);
blinkState = !blinkState;
counter++;
display.clearDisplay();
display.setCursor(0,0);
display.print(counter);
display.display();
Serial.print(counter); Serial.print("\n");
delay(200);
}
The interesting part is, that the same code on the same board with the same circuit stops after 1 to 5 cycles. But why?
Everything this code should do is let the LED blink and print a increasing number on the OLED display.
After counting a couple of cycles (random between 1 and 5) it seams like the Teensy 3.1 got stuck. The OLED display shows the last number and the LED stays in the state it has.
Is there a problem in the lib, in the code, or is it just to late at night
Last edited: