iI want to make a countdown timer with a lily pad arduinoLilyPad Arduino for 3 secondseconds with red (1 second), then orange(1 second), then yellow (1 second) ,then then green (3 seconds), all being triggered by a button. iI want to check to see if iI have the right code, i. I am a self taught programmer, so i 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 ++;
}
}
}
#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 ++;
}
}
}