Skip to content

Instantly share code, notes, and snippets.

@yamamaya
Created May 12, 2020 14:33
Show Gist options
  • Save yamamaya/f6f9c60d42f5e62b7757b1bd97c95325 to your computer and use it in GitHub Desktop.
Save yamamaya/f6f9c60d42f5e62b7757b1bd97c95325 to your computer and use it in GitHub Desktop.
Compatibility issues between AtWiFi and TFT_eSPI
//#define NO_WIFI
#ifndef NO_WIFI
#include <AtWiFi.h>
#endif
#include <TFT_eSPI.h>
TFT_eSPI tft;
const char* ssid = "***********";
const char* password = "**********";
void setup() {
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
#ifndef NO_WIFI
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(2000);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
#endif
}
const uint16_t colors[8] = {
TFT_BLACK,
TFT_BLUE,
TFT_RED,
TFT_MAGENTA,
TFT_GREEN,
TFT_CYAN,
TFT_YELLOW,
TFT_WHITE
};
int col = 0;
void loop() {
col ++;
if ( col == 8 ) {
col = 0;
}
tft.fillScreen( colors[col] );
delay( 10 );
}
@salmanfarisvp
Copy link

Did you found any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment