I am in the early stages of writing my program, but I have run into a problem. I am fairly new to Arduino so I'm not sure if there is something I am trying to do that doesn't work, but I am getting an error message
expected ; before ) token
on the line for(count <= 10).
I would really appreciate if someone could let me know why I am getting this error.
#include<EEPROM.h>
const int LED = 12;
const int SWITCH = 4;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(LED, OUTPUT); //LED is always outputting information
pinMode(LED_BUILTIN, OUTPUT); //Built in LED is always outputting information
pinMode(SWITCH, INPUT_PULLUP); //Switch inputs value when in/out of ground
}
void loop() {
// put your main code here, to run repeatedly:
int addr = 0; //Declaring variables
int count = 0;
int seconds;
if (digitalRead(SWITCH) == LOW) {
Serial.println("----Recording----");
for (count <= 10) {
while (digitalRead(SWITCH) == LOW) {
count = count + 1;
digitalWrite(LED, LOW);
delay(50);
}
else {
count = count + 1;
digitalWrite(LED, HIGH);
delay(50);
}
} else {
digitalWrite(LED_BUILTIN, HIGH); //Internal LED blinks
delay (300);
digitalWrite(LED_BUILTIN, LOW);
delay(300);
}
}
}
while (count <= 10) {orfor ( ; count<=0; ) {- find some C tutorial to learn about correct syntaxforandwhileblocks do not have anelse. Onlyifblocks do. Look at some basic C examples.