Mac Lobdell / Mbed 2 deprecated testSerialDisplay

Dependencies:   mbed

main.cpp

Committer:
maclobdell
Date:
2016-01-07
Revision:
0:7c02f96b0f96
Child:
1:3eabffe99403

File content as of revision 0:7c02f96b0f96:

#include "mbed.h"

int display(char* buffer);

DigitalOut myled(LED1);

Serial lcd(D1,D0);


int main() {
    
    char buffer[32];
   
    lcd.baud(9600);  //default

   /* LOLShield only handles upper case and doesn't handle ? */

//    sprintf(buffer, " HOLA MUNDO, WHATS UP      \n");
    
//    lcd.printf(buffer);

/*test of spark fun serial display */

/* you can move the cursor dumb ass!!*/
/* https://www.sparkfun.com/tutorials/246 */

   //turn on the display
   //can I have a FET turn on the display power?
   
   //turn off the splash screen
   lcd.sendbyte(124); //send special character
   lcd.sendbyte(9);// send special character to turn off splash screen

    wait (0.5);  //wait for display to boot up
   
   //change cursor location
   lcd.sendbyte(254); //send special character to change cursor location 
   lcd.sendbyte(128);// send special character to set cursor to beginning of first line
 
   //display message
   sprintf(buffer, " BYE FROM MAC      \n");
   lcd.printf(buffer);

   lcd.sendbyte(124); //send special character to change cursor location 
   lcd.sendbyte(9);// send special character to change brightnes 128 - 157

   lcd.sendbyte(254); //send special character to change cursor location 
   lcd.sendbyte(1);// send special character to clear display


    while(1) {
        
        myled = 1;
        wait(0.5);
        myled = 0;
        wait(0.5); 
    }
}
/*
int display(char* buffer)
{
        uint32_t i = 0;
        for (i = 0; i<32; i++)
        {    lcd.printf(" ");
        }
        for (i = 0; i<32; i++)
        {    lcd.printf("\b");
        }
        for (i = 0; i<32; i++)
        {    lcd.printf("%s",buffer[i]);
        }
}
*/