WIP

Dependencies:   mbed

main.cpp

Committer:
mnewton1
Date:
2013-04-06
Revision:
0:2df1d679a1bd

File content as of revision 0:2df1d679a1bd:

#include "mbed.h"

unsigned char splash[] = //splash screen string
{
    254, 57, 51, //change baud rate to 19200
    254, 88, //clear screen
    254, 82, //auto scroll off
    254, 71, 4, 2, //set cursor column 4, row 2
    70, 111, 114, 109, 117, 108, 97, 32, 72, 121, 98, 114, 105, 100, //print "Formula Hybrid"
};

unsigned char data[] = //data screen initialization string
{
    254, 88, //clear screen
    254, 72, //set cursor home
    83, 112, 101, 101, 100, 32, 32, 32, 32, 32, 32, 58, //print "Speed: "
    254, 71, 1, 2, //set curser to column 1, row 2
    73, 67, 69, 32, 84, 101, 109, 112, 32, 32, 32, 58, 32, 32, 32, 32, 32, 32,//print "ICE Temp: "
    254, 71, 1, 3, //set curser to column 1, row 3
    72, 86, 32, 66, 97, 116, 116, 101, 114, 121, 32, 58, 32, 32, 32, 32,  //print "HV Battery: "
    254, 71, 1, 4, //set curser to column 1, row 4
    70, 117, 101, 108, 32, 76, 101, 118, 101, 108, 32, 58 //print "Fuel Level: "
};

   
int main() 
{
    Serial lcd(p9, p10); // tx, rx
    lcd.baud(19200);
    
    void loop();
    {
        for(int i = 0; i <= sizeof(splash); ++i)
        {
            lcd.putc(splash[i]);
            wait(0.05);
        }
    
        wait(5);
    
        for(int j = 0; j <= sizeof(data); ++j)
        {
            lcd.putc(data[j]);
         wait(0.0001);
        }
        
    }
}