I want to make a countdown timer with a LilyPad Arduino for 3 seconds with red (1 second), then orange(1 second), then yellow (1 second), then green (3 seconds), all being triggered by a button. I want to check to see if I have the right code. I am a self taught programmer, so apologies if this is a little messy. (or a lot)
#include <Adafruit_NeoPixel.h>
const int inputPin = 3;
void setup() {
// put your setup code here, to run once:
pinMode(inputPin, INPUT_PULLUP);
strip.begin();
strip.show();
}
void loop() {
// put your main code here, to run repeatedly:
If (digitalRead (inputPin) == LOW) {
For (int i = 0; i < 12; I++) {
Int pixelNum1 = 1;
strip.setPixelColor( pixelNum1, 244, 0, 0);
strip.show();
delay (27);
pixelNum1 ++;
}
For (int i = 0; i < 24; I++) {
Int pixelNum2 = 1;
strip.setPixelColor( pixelNum, 247, 247, 0)
strip.show();
delay (27);
pixelNum ++;
}
For (int i = 0; i < 12; I++) {
Int pixelNum3 = 1;
strip.setPixelColor( pixelNum, 0, 247, 41)
strip.show();
delay (27);
pixelNum ++;
}
}
}
If,For, andIntare not valid C++ keywords (unless you have some defines/typedefs). Please post the actual code.iandIare not the same variable