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.
Diff: main.cpp
- Revision:
- 0:7c02f96b0f96
- Child:
- 1:3eabffe99403
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Jan 07 20:06:36 2016 +0000
@@ -0,0 +1,75 @@
+#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]);
+ }
+}
+*/
+
+
\ No newline at end of file