Very basic test program for Picaso Serial library.

Dependencies:   mbed uLCD_4D_Picaso

main.cpp

Committer:
admcrae
Date:
2015-03-06
Revision:
0:c39433c50bf6
Child:
1:9fcad04e0a0d

File content as of revision 0:c39433c50bf6:

#include "mbed.h"
#include "uLCD_4D_Picaso.h"
#include "Picaso_const4D.h"

uLCD_4D_Picaso lcd(p28, p27, p30);

int main() {
    printf("Hello\r\n");
    lcd.gfx_Circle(120, 160, 50, RED);
    wait(1);
    printf("%d\r\n", uLCD_4D_Picaso::BAUD_2400);
    lcd.setbaudWait(uLCD_4D_Picaso::BAUD_2400);
    lcd.gfx_Circle(100, 100, 40, BLUE);
    lcd.setbaudWait(uLCD_4D_Picaso::BAUD_600000);
    lcd.gfx_Circle(150, 80, 20, GREEN);
    wait(1);
    lcd.gfx_Cls();
    
    for (int i = 0; i < 20; ++i) {
        for (int j = 0; j < 30; ++j) {
            lcd.gfx_Circle(10+10*i, 10+10*j, 7, WHITE);
        }
    }
    
    wait(1);
    
    lcd.touch_Set(0);
    lcd.touch_DetectRegion(0, 0, 100, 100);
    
    int x,y;
    while(1) {
        if (lcd.touch_Get(0) == 1) {
            x = lcd.touch_Get(1);
            y = lcd.touch_Get(2);
            printf("Touch detected: x = %d, y = %d.\r\n", x, y);
        }
    }
}