sample test program with Mx64

Dependencies:   C12832_lcd MX64 SerialHalfDuplex mbed

main.cpp

Committer:
ppr2013G2
Date:
2014-06-27
Revision:
1:d0d0678ac9da
Parent:
0:782e99c3f9fd

File content as of revision 1:d0d0678ac9da:

#include "mbed.h"
#include "MX64.h"
#include "C12832_lcd.h"

AnalogIn pot1(p19);
C12832_LCD lcd;


int main()
{
    MX64 mymx64 (p9, p10, 22); //for LPC1768
    int deg;
    while (1) {
        lcd.cls();//clear screen
        lcd.locate(40,3);//set locate
        lcd.printf("!Hello Mx64!");
        lcd.line(0, 13, 128, 13, 1);//draw a line
        deg=(int)(pot1*360);
        lcd.locate(0,15);//set locate
        lcd.printf("Pos:%g,Temp:%g,Volt%g",mymx64.GetPosition(),mymx64.GetTemp(),mymx64.GetVolts());
        mymx64.SetGoal(deg);    // set mx64 go to deg
        wait(0.1);
    }
}