Created
November 12, 2024 18:08
-
-
Save trading-developer/195edfb9b2d21d01a80c62a1c243a604 to your computer and use it in GitHub Desktop.
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
#include <TFT_eSPI.h> | |
#include <WiFi.h> | |
TFT_eSPI display = TFT_eSPI(); | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Connecting to WiFi..."); | |
WiFi.begin(ssid, password); | |
int attempts = 0; | |
while (WiFi.status() != WL_CONNECTED && attempts < 20) { | |
delay(500); | |
Serial.print("."); | |
attempts++; | |
} | |
if (WiFi.status() == WL_CONNECTED) { | |
Serial.println("\nConnected to WiFi"); | |
display.init(); | |
display.setRotation(1); | |
display.fillScreen(TFT_WHITE); | |
display.setTextColor(TFT_BLACK); | |
display.setTextSize(2); | |
display.setCursor(10, 10); | |
display.println("Connected!"); | |
delay(2000); | |
display.fillScreen(TFT_RED); | |
delay(1000); | |
display.fillScreen(TFT_GREEN); | |
delay(1000); | |
display.fillScreen(TFT_BLUE); | |
delay(1000); | |
display.fillScreen(TFT_WHITE); | |
} else { | |
Serial.println("\nFailed to connect to WiFi"); | |
} | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment