Last active
August 29, 2015 14:25
-
-
Save NapapornSantong/cb8432cde72ca1dc40dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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