Can the (if statement) have A counter on it?
hi read this. i know if (if statement) can have counter on it. count ten , stop hole program. here little bit of code want run 10 times , go (state = 0) , turn off arduino or stop code going on. code: [select] if (counter > maxnum) { // turn led on: state = 1; } else { // turn led off: state = 0; delay(10); } all of program code: [select] const int ledpin = 9; int inputpin = a5; int sensorvalue; int counter = 0; int maxnum = 200; byte state; void setup() { pinmode(ledpin, output); serial.begin(9600); } void loop() { // serial.print("input on pin 5: "); // serial.println(sensorvalue); serial.print("led state: "); serial.println(state); // serial.print("counter:...