mbed Demo Display that shows several of the features

Dependencies:   MSCUsbHost mbed Servo SRF08

Files at this revision

API Documentation at this revision

Comitter:
demo
Date:
Mon Sep 20 21:14:34 2010 +0000
Commit message:

Changed in this revision

FATFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
ID12RFID.lib Show annotated file Show diff for this revision Revisions of this file
MSCUsbHost.lib Show annotated file Show diff for this revision Revisions of this file
SRF08.lib Show annotated file Show diff for this revision Revisions of this file
Servo.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 aef73ca5c41c FATFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FATFileSystem.lib	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_unsupported/code/fatfilesystem/
\ No newline at end of file
diff -r 000000000000 -r aef73ca5c41c ID12RFID.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ID12RFID.lib	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/ID12RFID/#f04afa911cf5
diff -r 000000000000 -r aef73ca5c41c MSCUsbHost.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MSCUsbHost.lib	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/chris/code/MSCUsbHost/#cfb58054ab28
diff -r 000000000000 -r aef73ca5c41c SRF08.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SRF08.lib	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/chris/code/SRF08/#ba04e9cd48fc
diff -r 000000000000 -r aef73ca5c41c Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r aef73ca5c41c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+#include "SRF08.h"
+#include "Servo.h"
+#include "ID12RFID.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+PwmOut led3(LED3);
+
+SRF08 srf08(p28, p27, 0xE0);      // Define SDA, SCL pin and I2C address
+PwmOut meter (p22);
+Servo servo (p21);
+AnalogIn pot (p18);
+ID12RFID rfid (p10);
+AnalogIn th (p19);
+LocalFileSystem fs ("fs");
+
+int main() {
+
+    FILE *fp = fopen("/fs/hello.txt","w");
+    fprintf(fp,"Hello World!\n");
+    fclose(fp);
+
+    while (1) {
+
+        // Check to see if an RFID tag has been presented, if so, display it
+        if (rfid.readable()) {
+            printf("ID Tag : %d\n",rfid.read());
+            led1 = !led1;
+        }
+
+        // If the middle pot is more than half way 
+        // read and display from the Ultrasonic range finder
+        if (th.read() > 0.5) {
+            float measure = srf08.read();
+            printf("Measured range : %.2f cm\n",measure);
+            meter = 1.0 - (measure/44.0);
+            led2 = !led2;
+        }
+        
+        // Move the servo to reflect the pot
+        servo = pot.read();
+        led3.write(pot.read());
+        wait(0.1);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r aef73ca5c41c mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 20 21:14:34 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da