![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Dependencies: dispBoB mbed PCA9635
Revision 1:0b80876face4, committed 2011-07-11
- Comitter:
- d_worrall
- Date:
- Mon Jul 11 13:58:21 2011 +0000
- Parent:
- 0:43293cba961c
- Commit message:
Changed in this revision
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 |
diff -r 43293cba961c -r 0b80876face4 counter.cpp --- a/counter.cpp Fri Jul 08 14:55:33 2011 +0000 +++ b/counter.cpp Mon Jul 11 13:58:21 2011 +0000 @@ -1,20 +1,21 @@ -#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" -} +#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.init(); + 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" +}
diff -r 43293cba961c -r 0b80876face4 dispBoB.lib --- a/dispBoB.lib Fri Jul 08 14:55:33 2011 +0000 +++ b/dispBoB.lib Mon Jul 11 13:58:21 2011 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/d_worrall/code/dispBoB/#10570d97f4d3 +http://mbed.org/users/d_worrall/code/dispBoB/#a9abac3696b0