help fix sketch - needs to repeat this Light pattern 3X then stop:
Turn LED on for one second, off for one second
Turn LED on for two seconds, off for one second
Turn LED on for three seconds, off for one second
Turn LED on for four seconds, off for a second
Turn LED on for five seconds, off for a second
Delay five seconds
Arduino: 1.6.5 (Mac OS X), Board: "Arduino Uno"
sketch_sep12flashLight:18: error: expected unqualified-id before 'for'
sketch_sep12flashLight:18: error: 'i' does not name a type
sketch_sep12flashLight:18: error: 'i' does not name a type
expected unqualified-id before 'for'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Sketch:
void setup() {
// put your setup code here, to run once:
#define LED 13
int i(13);
pinMode(LED, OUTPUT);
digitalWrite(LED,LOW);
}
void loop(void) {
flashLight(1,1); //turn the LED on (HIGH is the voltage level) for one second, off for one second
flashLight(2,1); //turn the LED on for two seconds, off for one second
flashLight(3,1); //turn the LED on for three seconds, off for a second
flashLight(4,1); //turn the LED on for four seconds, off for a second
flashLight(5,1); //turn the LED on for five seconds, off for a second
delay(5000); //followed by a delay of five seconds
}
for(i=0;i<3; i++1){
}
void flashLight(int onTime, int offTime) {
digitalWrite(LED, HIGH); delay(1000onTime);
digitalWrite(LED, LOW); delay(1000offTime);
}
sketch_sep12flashLight.ino (856 Bytes)