-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add analogWrite HAL for esp32 and its example (#23)
- Loading branch information
Showing
5 changed files
with
53 additions
and
4 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,31 @@ | ||
/* | ||
ALKS faded LED example | ||
Example with fading LED. | ||
Source: https://github.com/ERROPiX/ESP32_AnalogWrite/blob/master/examples/ledFade/ledFade.ino | ||
Modified by Kryštof Černý (@CornyjK) @RoboticsBrno | ||
*/ | ||
|
||
#include <ALKS.h> | ||
|
||
int brightStep = 1; | ||
int brightness = 0; | ||
|
||
void setup() | ||
{ | ||
setupAll(); | ||
} | ||
|
||
void loop() | ||
{ | ||
brightness += brightStep; | ||
if (brightness == 0 || brightness == 255) | ||
{ | ||
brightStep = -brightStep; | ||
} | ||
|
||
analogWrite(L_RGB_R, brightness); | ||
|
||
delay(10); | ||
} |
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 |
---|---|---|
|
@@ -41,6 +41,10 @@ | |
}, | ||
{ | ||
"name": "Adafruit Unified Sensor" | ||
}, | ||
{ | ||
"name": "ESP32 AnalogWrite", | ||
"platforms": "espressif32" | ||
} | ||
] | ||
} |
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