I'm having this strange issue in the IDE2.0, where I loaded a couple of sketches, including an old one I know worked great, and for some reason I'm getting 'undeclared identifier' errors in stuff like 'INPUT' or 'HIGH' for some reason. It doesn't even appear to be present in all instances of these words.
I don't understand what's happening.
It's the first time using IDE on this computer, and I just installed the Arduino AVR Boards because I will use a Mega 2560.
I don't think I'm missing a library or something like that because then otherwise the errors would be constant, but you can see in one of the images some 'delay()' are marked and other not.
TheMemberFormerlyKnownAsAWOL:
Post code and error messages, not pictures.
Ok sure. It was to show the red underline that appears. I'm not getting any actual error other than when hovering witht the mouse.
Here's the entire code for a test sketch I wrote:
int pushButton = 2;
int backbutton = 4;
int counter1 = 0;
int A = 3;
int B = 5;
int C = 8;
int sequence[]= {A, B, C, A, B};
int taille = 5;
int pushState;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(pushButton,INPUT);
pinMode(A, OUTPUT);
pinMode(A+1, OUTPUT);
pinMode(B, OUTPUT);
pinMode(B+1, OUTPUT);
pinMode(C, OUTPUT);
pinMode(C+1, OUTPUT);
digitalWrite (A, HIGH);
digitalWrite (A+1, HIGH);
digitalWrite (B, HIGH);
digitalWrite (B+1, HIGH);
digitalWrite (C, HIGH);
digitalWrite (C+1, HIGH);
}
// the loop routine runs over and over again forever:
void loop() {
if (counter1 < taille) {
Serial.println(counter1);
Serial.println(pushState);
allumer (sequence[counter1], sequence[counter1+1], sequence[counter1 -1]);
}
else { counter1 = 0;}
}
void allumer (int trame1, int trame2, int trame3){
digitalWrite(trame1 +1, HIGH);
digitalWrite(trame3,HIGH);
digitalWrite(trame1,LOW);
digitalWrite(trame2 +1,LOW);
int pushState = digitalRead(pushButton);
if (pushState == HIGH) {
counter1 ++;
delay(10);
return;
}
else {
// Serial.println(counter1);
delay (10);
}
}