Created
February 17, 2015 00:55
-
-
Save AlexJWayne/a9279ba8fc249b54d317 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #define SENSOR_START_INDEX 4 | |
| #define SENSOR_END_INDEX 8 | |
| void loop() { | |
| bool sensorIsTripped = readFromSensor(); | |
| for (var i = 0; i < NUM_LEDS; i++) { | |
| if (sensorIsTripped && i >= SENSOR_START_INDEX && i < SENSOR_END_INDEX) { | |
| leds[i] = CGRB::Green; | |
| } else { | |
| leds[i] = CRGB::Red; | |
| } | |
| } | |
| FastLED.show(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment