by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
robt
Date:
Sun Jun 16 15:30:01 2013 +0000
Commit message:
by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

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 000000000000 -r d008cfe824aa main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jun 16 15:30:01 2013 +0000
@@ -0,0 +1,30 @@
+/* Program Example 12.4: Paired Bluetooth master program
+                                                            */
+#include "mbed.h"
+Serial rn41(p9,p10);
+BusOut led(LED4,LED3,LED2,LED1);
+DigitalIn Din(p26);                // digital switch input on pin 14
+
+char x;
+void initialise_connection(void);
+
+int main() {
+  rn41.baud(115200);
+  initialise_connection();
+  while (1) {
+    if (Din==1) {            // if digital input switched high   
+      x=0x0F;              // override with 0x0F
+    } else {
+      x++;                 // else increment and
+      if (x>0x0F) {        // output count value
+        x=0;
+      }
+    }
+    rn41.putc(x);            // send char data on serial
+    led = x;                 // set LEDs to count in binary
+    wait(0.5);
+  }
+}
+
+// add function initialise_connection code here...
+
diff -r 000000000000 -r d008cfe824aa mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jun 16 15:30:01 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file