diff --git a/examples/backlight/BacklightBlink/BacklightBlink.ino b/examples/backlight/BacklightBlink/BacklightBlink.ino new file mode 100644 index 0000000..b6230b2 --- /dev/null +++ b/examples/backlight/BacklightBlink/BacklightBlink.ino @@ -0,0 +1,25 @@ +/* + * This example shows how to change the backlight intensity of the GIGA Display Shield. + * + * The backlight intensity is set by passing a number between 0 and 100 to the .set() method. + * Here we set the backlight to 0% and 100% intensity in a loop, changing the value every 1 second. + * + * Initial author: Martino Facchin @facchinm + * Modified by: Ali Jahangiri @aliphys + */ + +#include + +//Create backlight object +GigaDisplayBacklight backlight; + +void setup() { + backlight.begin(); +} + +void loop() { + backlight.set(0); // backlight off - 0% + delay(1000); + backlight.set(100); // backlight on - 100% + delay(1000); +} diff --git a/examples/backlight/SimpleBacklight/SimpleBacklight.ino b/examples/backlight/SimpleBacklight/SimpleBacklight.ino deleted file mode 100644 index 922ed51..0000000 --- a/examples/backlight/SimpleBacklight/SimpleBacklight.ino +++ /dev/null @@ -1,20 +0,0 @@ -/* - Changes the display backlight from very dim to 100% - This example code is in the public domain. -*/ - -#include - -//Create backlight object -GigaDisplayBacklight backlight; - -void setup() { - //init library - backlight.begin(); -} - -int i = 0; -void loop() { - backlight.set(i++ % 100); - delay(100); -}