Created
April 16, 2021 22:32
-
-
Save jdan/74e82ea0b42d1c25e4abd47b08803658 to your computer and use it in GitHub Desktop.
Arduino code to display hash.jordanscales.com art on an inkplate.io display
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 "Inkplate.h" | |
#include <HTTPClient.h> | |
#include <WiFi.h> | |
Inkplate display(INKPLATE_1BIT); | |
// https://github.com/jdan/hashart#a-small-screenshot-service | |
char *url = "https://FILLMEIN/random/800/600/random.png"; | |
void setup() | |
{ | |
display.begin(); | |
display.clearDisplay(); | |
display.clean(); | |
display.setCursor(50, 290); | |
display.setTextSize(3); | |
display.print(F("Loading art")); | |
display.display(); | |
WiFi.begin("www.example.com", "wifisucks"); | |
while (WiFi.status() != WL_CONNECTED) | |
{ | |
delay(100); | |
display.print("."); | |
display.partialUpdate(); | |
} | |
display.print("Connected!"); | |
display.partialUpdate(); | |
} | |
void loop() | |
{ | |
if (WiFi.status() != WL_CONNECTED) | |
{ | |
WiFi.reconnect(); | |
delay(5000); | |
} | |
display.clearDisplay(); | |
display.drawImage(url, 0, 0, 0, 0); | |
display.display(); | |
// Sleep for 60 seconds | |
esp_sleep_enable_timer_wakeup(1000L * 60000L); | |
(void)esp_light_sleep_start(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment