first take

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld by Simon Ford

Revision:
3:dfdc05f63423
Parent:
2:ad0b044d0a10
--- 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);
+        }
+        
 }