Update examples

Now compatible with ESP8266
This commit is contained in:
Bodmer committed 2017-02-24 21:00:40 +00:00
1 parent 56f4599cfd
commit b7315803f4
17 files changed
+343 -473

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
// We need this header file to use FLASH as storage with PROGMEM directive:
#include <avr/pgmspace.h>
#include <pgmspace.h>
// Icon width and height
const uint16_t alertWidth = 32;
+1 -1
View File
@@ -1,5 +1,5 @@
// We need this header file to use FLASH as storage with PROGMEM directive:
#include <avr/pgmspace.h>
#include <pgmspace.h>
// Icon width and height
const uint16_t closeWidth = 32;
@@ -8,6 +8,7 @@
// Icons are stored in tabs, e.g. Alert.h etc
// more than one icon can be in a header file.
// Original sketch header follow:
/*
This sketch demonstrates loading images from arrays stored in program (FLASH) memory.
@@ -42,7 +43,7 @@ void setup()
tft.fillScreen(TFT_BLACK);
// Draw the icons
drawIcon(info, (tft.width() - infoWidth)/2 - 50, (tft.height() - infoHeight)/2, infoWidth, infoHeight);
drawIcon(info, (tft.width() - infoWidth)/2 - 50, (tft.height() - infoHeight)/2, infoWidth, infoHeight);
drawIcon(alert, (tft.width() - alertWidth)/2, (tft.height() - alertHeight)/2, alertWidth, alertHeight);
drawIcon(close, (tft.width() - closeWidth)/2 + 50, (tft.height() - closeHeight)/2, closeWidth, closeHeight);
@@ -54,7 +55,7 @@ void setup()
void loop()
{
// Loop filling and clearing screen
drawIcon(info, random(tft.width() - infoWidth), random(tft.height() - infoHeight), infoWidth, infoHeight);
drawIcon(info, random(tft.width() - infoWidth), random(tft.height() - infoHeight), infoWidth, infoHeight);
drawIcon(alert, random(tft.width() - alertWidth), random(tft.height() - alertHeight), alertWidth, alertHeight);
drawIcon(close, random(tft.width() - closeWidth), random(tft.height() - closeHeight), alertWidth, closeHeight);
+1 -1
View File
@@ -1,5 +1,5 @@
// We need this header file to use FLASH as storage with PROGMEM directive:
#include <avr/pgmspace.h>
#include <pgmspace.h>
// Icon width and height
const uint16_t infoWidth = 32;