Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <NeoPixelBus.h>
#define pixelCount 1
#define colorSaturation 128
NeoPixelBus strip = NeoPixelBus(pixelCount, 5);
RgbColor red = RgbColor(255);
RgbColor Low = RgbColor(0, 0, 0);
void setup() {
// put your setup code here, to run once:
pinMode(4,INPUT);
Serial.begin(115200);
delay(50);
strip.Begin();
strip.Show();
}
void loop() {
if(digitalRead(4) == 1)
{
Serial.println("ooooooooooooooooooooooooooooooooooo");
strip.SetPixelColor(0,red);
strip.Show();
}
else
{
Serial.println("ooooooooooooo");
strip.SetPixelColor(0,Low);
strip.Show();
}
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.