Hallo, ich habe ein kleines Script geschrieben, welches auf meinem OLED-Display mit der random()-Funktion einen Matrix-Bildschirm simuliert. jedoch bekomme ich durchgehend den Error aus dem Titel. Hier der Code:
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
long step0 = random(1000000000000,9999999999999);
long step1 = 0;
long step2 = 0;
long step3 = 0;
long step4 = 0;
long step5 = 0;
}
void loop() {
step5 = step4;
step4 = step3;
step3 = step2;
step2 = step1;
step1 = step0;
step0 = random(1000000000000,9999999999999);
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(1,0);
display.println(step0);
display.setCursor(1,7);
display.println(step1);
display.setCursor(1,14);
display.println(step2);
display.setCursor(1,21);
display.println(step3);
display.setCursor(1,28);
display.println(step4);
display.setCursor(1,35);
display.println(step5);
display.display();
delay(100);
}
Und der komplette Error:
E:\Dokumente\Arduino\matrix_oled.ino\matrix_oled.ino.ino: In function 'void setup()':
E:\Dokumente\Arduino\matrix_oled.ino\matrix_oled.ino.ino:7:50: warning: overflow in implicit constant conversion [-Woverflow]
long step0 = random(1000000000000,9999999999999);
^
E:\Dokumente\Arduino\matrix_oled.ino\matrix_oled.ino.ino:7:50: warning: overflow in implicit constant conversion [-Woverflow]
E:\Dokumente\Arduino\matrix_oled.ino\matrix_oled.ino.ino: In function 'void loop()':
matrix_oled.ino:18: error: 'step5' was not declared in this scope
step5 = step4;
^
matrix_oled.ino:18: error: 'step4' was not declared in this scope
step5 = step4;
^
matrix_oled.ino:19: error: 'step3' was not declared in this scope
step4 = step3;
^
matrix_oled.ino:20: error: 'step2' was not declared in this scope
step3 = step2;
^
matrix_oled.ino:21: error: 'step1' was not declared in this scope
step2 = step1;
^
matrix_oled.ino:22: error: 'step0' was not declared in this scope
step1 = step0;
^
E:\Dokumente\Arduino\matrix_oled.ino\matrix_oled.ino.ino:23:45: warning: overflow in implicit constant conversion [-Woverflow]
step0 = random(1000000000000,9999999999999);
^
E:\Dokumente\Arduino\matrix_oled.ino\matrix_oled.ino.ino:23:45: warning: overflow in implicit constant conversion [-Woverflow]
exit status 1
'step5' was not declared in this scope
Kann mir jemand sagen was falsch ist?