Created
May 12, 2020 14:33
-
-
Save yamamaya/f6f9c60d42f5e62b7757b1bd97c95325 to your computer and use it in GitHub Desktop.
Compatibility issues between AtWiFi and TFT_eSPI
This file contains hidden or 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
//#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 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you found any solution?