-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from arduino-libraries/nano_esp32
Arduino NANO ESP32 support
- Loading branch information
Showing
5 changed files
with
89 additions
and
2 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
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,56 @@ | ||
/* | ||
* Blink for Arduino NANO ESP32 board | ||
* | ||
* This sketch can be used to generate an example binary that can be uploaded to ESP32 via OTA. | ||
* It needs to be used together with OTA.ino | ||
* | ||
* Steps to test OTA: | ||
* 1) Upload this sketch or any other sketch (this one this one lights up the RGB LED with different colours). | ||
* 2) In the IDE select: Sketch -> Export compiled Binary | ||
* 3) Upload the exported binary to a server | ||
* 4) Open the related OTA.ino sketch and eventually update the OTA_FILE_LOCATION | ||
* 5) Upload the sketch OTA.ino to perform OTA | ||
*/ | ||
|
||
void setLed(int blue, int gree, int red) { | ||
if (blue == 1) { | ||
digitalWrite(LED_BLUE, LOW); | ||
} | ||
else { | ||
digitalWrite(LED_BLUE, HIGH); | ||
} | ||
|
||
if (gree == 1) { | ||
digitalWrite(LED_GREEN, LOW); | ||
} | ||
else { | ||
digitalWrite(LED_GREEN, HIGH); | ||
} | ||
|
||
if (red == 1) { | ||
digitalWrite(LED_RED, LOW); | ||
} | ||
else { | ||
digitalWrite(LED_RED, HIGH); | ||
} | ||
} | ||
|
||
|
||
void setup() | ||
{ | ||
pinMode(LED_BLUE, OUTPUT); | ||
pinMode(LED_GREEN, OUTPUT); | ||
pinMode(LED_RED, OUTPUT); | ||
} | ||
|
||
void loop() | ||
{ // Blue LED on | ||
setLed(1, 0, 0); | ||
delay(1000); | ||
// Green LED on | ||
setLed(0, 1, 0); | ||
delay(1000); | ||
// Red LED on | ||
setLed(0, 0, 1); | ||
delay(1000); | ||
} |
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
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
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