Formatting
This commit is contained in:
parent
0670fbc35f
commit
bb665628a7
@ -28,7 +28,8 @@ void setup()
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
Serial.println("Connecting");
|
||||
while(WiFi.status() != WL_CONNECTED) {
|
||||
while (WiFi.status() != WL_CONNECTED)
|
||||
{
|
||||
delay(1000);
|
||||
Serial.print(".");
|
||||
}
|
||||
@ -43,7 +44,8 @@ void setup()
|
||||
hibernate_and_restart();
|
||||
}
|
||||
|
||||
void fetchAndDrawImage(const char* url) {
|
||||
void fetchAndDrawImage(const char *url)
|
||||
{
|
||||
HTTPClient http;
|
||||
|
||||
http.begin(url);
|
||||
@ -52,7 +54,8 @@ void fetchAndDrawImage(const char* url) {
|
||||
http.addHeader("Content-Type", "application/json");
|
||||
int httpCode = http.POST(einkDisplayProperties);
|
||||
|
||||
if (httpCode > 0) {
|
||||
if (httpCode > 0)
|
||||
{
|
||||
int length = http.getSize();
|
||||
|
||||
Serial.print("Length of payload: ");
|
||||
@ -64,14 +67,17 @@ void fetchAndDrawImage(const char* url) {
|
||||
drawImage(payload);
|
||||
|
||||
delete[] payload;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.println("Error on HTTP request");
|
||||
}
|
||||
|
||||
http.end();
|
||||
}
|
||||
|
||||
void hibernate_and_restart() {
|
||||
void hibernate_and_restart()
|
||||
{
|
||||
// Go to sleep and wake up later
|
||||
Serial.print("Begining hibernation. Waking up in ");
|
||||
Serial.print(HIBERNATE_TIME_SEC);
|
||||
|
Loading…
x
Reference in New Issue
Block a user