Skip to main content
1 of 2
Thomas
  • 1
  • 1
  • 1

How to Fix Problem With Arduino Program?

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);
    }
  }
}
Thomas
  • 1
  • 1
  • 1