first take

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
jn80842
Date:
Mon Nov 03 18:51:23 2014 +0000
Parent:
2:ad0b044d0a10
Commit message:
Project name and voltage displayed on LCD

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r ad0b044d0a10 -r dfdc05f63423 main.cpp
--- a/main.cpp	Sat Dec 04 11:31:07 2010 +0000
+++ b/main.cpp	Mon Nov 03 18:51:23 2014 +0000
@@ -1,10 +1,34 @@
-// Hello World! for the TextLCD
-
 #include "mbed.h"
 #include "TextLCD.h"
 
-TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
+DigitalOut led1(LED1);
+
+TextLCD lcd(D11,D10,D3,D2,D1,D0,TextLCD::LCD20x4);
+
+DigitalIn sda(PTE0);
+DigitalIn scl(PTE1);
+I2CSlave slave(PTE0, PTE1);
+//AnalogIn vol(A0);
+
+//const int addr = 0x90;
+char cmd[2];
+//slave.address = addr;
+
 
 int main() {
-    lcd.printf("Hello World!\n");
+    led1=1;
+    sda.mode(PullUp);
+    scl.mode(PullUp);
+    cmd[0] = '?';
+    cmd[1] = '!';
+    slave.address(0x90);
+    while(true) {
+        led1=!led1;
+        //float val = 3.3*vol;
+        slave.read(cmd,2);
+        lcd.printf("Toastboard!\n");
+        lcd.printf("%s\n",cmd);
+        wait(1);
+        }
+        
 }
diff -r ad0b044d0a10 -r dfdc05f63423 mbed.bld
--- a/mbed.bld	Sat Dec 04 11:31:07 2010 +0000
+++ b/mbed.bld	Mon Nov 03 18:51:23 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file