53 lines
935 B
Arduino
53 lines
935 B
Arduino
|
/*
|
||
|
* Copyright Paul Warren 2019 <pwarren@pwarren.id.au>
|
||
|
*
|
||
|
* Released under the terms of the GPLv3 license.
|
||
|
*/
|
||
|
#include "epd.h"
|
||
|
|
||
|
const int led = LED_BUILTIN;
|
||
|
|
||
|
// Font width
|
||
|
int dwidth = 185;
|
||
|
|
||
|
void ledOn(void) { digitalWrite(led, HIGH);}
|
||
|
void ledOff(void) { digitalWrite(led, LOW);}
|
||
|
void wait(void) { delay(1500);}
|
||
|
|
||
|
|
||
|
void setup() {
|
||
|
Serial.begin(115200); // Start serial communication
|
||
|
Serial.setTimeout(2000);
|
||
|
while (!Serial) { }
|
||
|
Serial.println("\r\n\r\nSTARTING\r\n");
|
||
|
|
||
|
epd_init();
|
||
|
epd_wakeup();
|
||
|
delay(1500);
|
||
|
epd_set_memory(MEM_TF);
|
||
|
epd_load_pic();
|
||
|
epd_set_memory(MEM_NAND);
|
||
|
delay(1500);
|
||
|
epd_clear();
|
||
|
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
int flag = 0;
|
||
|
|
||
|
delay(1500);
|
||
|
Serial.println("Files uploaded");
|
||
|
Serial.println("Please wait till screen LED goes flashes again");
|
||
|
|
||
|
while (1) {
|
||
|
if(flag) {
|
||
|
flag = 0;
|
||
|
ledOff();
|
||
|
} else {
|
||
|
flag = 1;
|
||
|
ledOn();
|
||
|
}
|
||
|
delay(1000);
|
||
|
}
|
||
|
}
|