/*******************************************************************************
    PocketScreen Load App From SD Example, Lines app
    written by Florian Keller
    last changed 13 Nov 20
    
    Part of the 'Load App From SD' example.
    To export a sketch as app, build it with Build Type 'Binary for SD card'
    and move the exported binary file (found in the sketch folder) to the SD.
*******************************************************************************/

#define LINECOLOR BLUE_16b

#include <PocketScreen.h>
PocketScreen pocketscreen = PocketScreen();

void setup() {
    pocketscreen.begin();
    pocketscreen.setBitDepth(BitDepth16);
}

void loop() {
    pocketscreen.clearScreen();
    
    // draw five random lines
    for (int i = 0; i < 5; i++) {
        int x0 = rand() % 96;
        int x1 = rand() % 96;
        int y0 = rand() % 64;
        int y1 = rand() % 64;
        pocketscreen.drawLine(x0, y0, x1, y1, LINECOLOR);
    }

    // wait 500ms
    delay(500);
}
