-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added example code tu turn leds off, for resetting the state
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"board": "espressif:esp32:nina_w10", | ||
"configuration": "UploadSpeed=115200", | ||
"port": "/dev/ttyUSB0", | ||
"sketch": "LED-OFF.ino" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Linux", | ||
"includePath": [ | ||
"/home/rac/Arduino/hardware/espressif/esp32/cores/esp32" | ||
], | ||
"browse": { | ||
"limitSymbolsToIncludedHeaders": false, | ||
"path": [ | ||
"/home/rac/Arduino/hardware/espressif/esp32/cores/esp32" | ||
] | ||
}, | ||
"intelliSenseMode": "clang-x64", | ||
"compilerPath": "/usr/bin/gcc", | ||
"cStandard": "c11", | ||
"cppStandard": "c++17" | ||
} | ||
], | ||
"version": 4 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* LED siren example for MakeZurich badge 2018 | ||
*/ | ||
#define FASTLED_ALLOW_INTERRUPTS 0 | ||
#include "FastLED.h" | ||
|
||
#define NUM_LEDS 2 | ||
#define DATA_PIN 27 // GPIO18 | ||
|
||
// Define the array of leds | ||
CRGB leds[NUM_LEDS]; | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
Serial.println("\n\nTurn LEDs off"); | ||
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); | ||
} | ||
|
||
void loop() { | ||
ledOff(); | ||
delay(5000); | ||
} | ||
|
||
void ledOff() { | ||
leds[0] = CRGB::Black; | ||
leds[1] = CRGB::Black; | ||
FastLED.show(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# LED OFF | ||
|
||
Turns off both LEDs on the MakeZurich badge 2018 to reset in case a new programm will be flashed that does not set the LED state hence they keep the last state. |