![](/media/cache/profiles/adf7ee2dcf142b0e11888e72b43fcb75.50x50_q85.jpg)
xx16 display +tmp102 +speaker
Dependencies: TextLCD mbed TMP102
Revision 0:1e8d2aa42655, committed 2011-02-06
- Comitter:
- monpjc
- Date:
- Sun Feb 06 17:37:24 2011 +0000
- Commit message:
Changed in this revision
--- /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
--- /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
--- /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 + //} + + +}
--- /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