Dependencies:   dispBoB mbed PCA9635

Files at this revision

API Documentation at this revision

Comitter:
d_worrall
Date:
Fri Jul 08 14:55:33 2011 +0000
Child:
1:0b80876face4
Commit message:
version1

Changed in this revision

PCA9635.lib Show annotated file Show diff for this revision Revisions of this file
counter.cpp Show annotated file Show diff for this revision Revisions of this file
dispBoB.lib 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCA9635.lib	Fri Jul 08 14:55:33 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/d_worrall/code/PCA9635/#16f968749855
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/counter.cpp	Fri Jul 08 14:55:33 2011 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+#include "dispBoB.h"
+
+dispBoB db(p28, p27, p26);          //instantiate a dispBoB object
+InterruptIn trigger(p12);           //set up the trigger as an external interrupt
+
+int counter = 0;                    //initialise counter object to zero
+
+void count(){                       //function to call upon interrupt
+    counter++;                      //increment counter object
+    db.locate(0);
+    db.printf("%06d", counter);     //print counter info to dispBoB 
+}
+
+int main() {
+    trigger.mode(PullUp);           //activate internal pull up (hardware specific)
+    db.cls();                       //clear screen
+    trigger.rise(&count);           //attach count() to interrupt on rising edge of trigger
+    db.printf("%06d", counter);     //display an inital count "000000"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dispBoB.lib	Fri Jul 08 14:55:33 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/d_worrall/code/dispBoB/#10570d97f4d3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 08 14:55:33 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912