Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- maclobdell
- Date:
- 2016-08-12
- Revision:
- 1:3eabffe99403
- Parent:
- 0:7c02f96b0f96
File content as of revision 1:3eabffe99403:
#include "mbed.h"
#define LOLSHIELDSERIALDISPLAY 0
#define SFSERIALDISPLAY 1
int display(char* buffer);
DigitalOut myled(LED1);
Serial lcd(D1,D0);
int main() {
char buffer[32];
lcd.baud(9600); //default
#if LOLSHIELDSERIALDISPLAY
/* Serial Interface to Arduino R3 w/ firmware to drive LOLShield*/
/* LOLShield library only handles upper case and doesn't handle ? */
sprintf(buffer, " HOLA MUNDO, WHATS UP \n");
lcd.printf(buffer);
#endif
#if SFSERIALDISPLAY
/*test of spark fun serial display */
/* you can move the cursor!*/
/* 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
#endif
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]);
}
}
*/