xx16 display +tmp102 +speaker

Dependencies:   TextLCD mbed TMP102

Files at this revision

API Documentation at this revision

Comitter:
monpjc
Date:
Sun Feb 06 17:37:24 2011 +0000
Commit message:

Changed in this revision

TMP102.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
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 000000000000 -r 1e8d2aa42655 TMP102.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TMP102.lib	Sun Feb 06 17:37:24 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/TMP102/#b469676e9a9e
diff -r 000000000000 -r 1e8d2aa42655 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sun Feb 06 17:37:24 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#e4cb7ddee0d3
diff -r 000000000000 -r 1e8d2aa42655 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Feb 06 17:37:24 2011 +0000
@@ -0,0 +1,54 @@
+// Hello World! for the TextLCD
+
+#include "mbed.h"
+#include "TextLCD.h"
+#include "TMP102.h"
+
+DigitalOut blue_led(LED1);
+DigitalOut speaker(p21);
+
+TMP102 temperature(p9, p10, 0x92); //A0 pin is connected to ground
+TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
+
+int main() {
+    
+    char buffer[32];
+    time_t seconds = time(NULL);
+    
+    set_time(1256729737);
+    printf("%s\n", buffer);
+    lcd.cls();
+    for (int i = 0 ; i <= 100 ; i += 1 )
+    {
+        speaker = !speaker;
+        wait (0.001); // 5kHz, with 10 steps
+    }
+    for (int i = 0 ; i <= 50 ; i += 1 )
+    {
+        speaker = !speaker;
+        wait (0.002); // 5kHz, with 10 steps
+    }
+    
+    
+    while(1)
+    {
+        lcd.cls();
+        seconds = time(NULL);
+        strftime(buffer, 32, "%X", localtime(&seconds));
+        lcd.printf("%s\n", buffer);
+        //printf("%s\n", buffer);
+        lcd.printf("Temp: %f\n", temperature.read());
+        blue_led = 1;
+        wait(0.5);
+        blue_led = 0;
+        wait(0.5);
+    }
+    
+    //while (1)
+    //{
+    //     speaker = !speaker;
+    //     wait (0.001); // 5kHz
+    //}
+    
+    
+}
diff -r 000000000000 -r 1e8d2aa42655 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Feb 06 17:37:24 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e