"expected primary expression before int" ive been staring at that massage for about 2 minutes >:( the code line i got it in is this digitalWrite (int thisled = 0; leds [thisled], HIGH);
the full code is this
i cant see why this is not working i am following this video step by step except for the numbers at the top the video link is this Freetronics Arduino Lab 3 (pause button) - YouTube can anyone help me?
Given below a revised copy of the codes of your original post. Go over every line and see if you can notice the difference and the reason for revision.
int leds = 13;
int ledDelay = 40;
int ledPins [] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
int buttonPin = 22;
int thisled = 0;
void setup () {
for (thisled = 0; thisled < leds; thisled++) { //no need declaring data type again; sometimes creates problem
pinMode (ledPins [thisled], OUTPUT);
}
pinMode (buttonPin, INPUT); //insert external pull-down/pull-up as needed
}
void loop () {
for (thisled < leds - 1; thisled++;) {
//digitalWrite (int thisled = 0; leds [thisled], HIGH);
digitalWrite(ledPins[thisled], HIGH); //shpuld be this; not above
delay (ledDelay);
while (digitalRead (buttonPin) == HIGH); { //why semicolon is here? Shpuld be deleted
delay(10);
}
//digitalWrite (ledPins [thistled], LOW
digitalWrite(ledPins[thisled], LOW); //should be this; not the above
}
}
Given below a revised copy of the codes of your original post. Go over every line and see if you can notice the difference and the reason for revision.
int leds = 13;
int ledDelay = 40;
int ledPins [] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
int buttonPin = 22;
int thisled = 0;
void setup () {
for (thisled = 0; thisled < leds; thisled++) { //no need declaring data type again; sometimes creates problem
pinMode (ledPins [thisled], OUTPUT);
}
pinMode (buttonPin, INPUT); //insert external pull-down/pull-up as needed
}
void loop () {
for (thisled < leds - 1; thisled++;) {
//digitalWrite (int thisled = 0; leds [thisled], HIGH);
digitalWrite(ledPins[thisled], HIGH); //shpuld be this; not above
delay (ledDelay);
while (digitalRead (buttonPin) == HIGH); { //why semicolon is here? Shpuld be deleted
delay(10);
}
//digitalWrite (ledPins [thistled], LOW
digitalWrite(ledPins[thisled], LOW); //should be this; not the above
}
}
i got some of the errors back to normal but cant figure out what you mean on others just a beginner sorry but can you please send full code with errors fixed because now it just turns on 1 LED then turns it of and then nothing
Take this line as an example. If the compiler complains about this a good starting point is to go to the language reference for the command/statement. This will give a sample of correct usage and syntax for same. Compare what you have against the standard and go from there.
purplemaniak7:
"expected primary expression before int" ive been staring at that massage for about 2 minutes
i cant see why this is not working i am following this video step by step except for the numbers at the top the video link is this https://www.youtube.com/watch?v=WmYglLwAAlU can anyone help me?
purplemaniak7:
i got some of the errors back to normal but cant figure out what you mean on others just a beginner sorry but can you please send full code with errors fixed because now it just turns on 1 LED then turns it of and then nothing
@purplemaniak7:
If English is your native language, how about writing in English? That means paragraphs, sentences, capitalization, and punctuation. BTW, you should stare at if for maybe 2 hours before asking for free help.
gfvalvo: @purplemaniak7:
If English is your native language, how about writing in English? That means paragraphs, sentences, capitalization, and punctuation. BTW, you should stare at if for maybe 2 hours before asking for free help.
I find that i HAVE stared at that for about 2 hours now because i posted that about a week ago.