Demo code minor BioRobotics 2016 University of Twente, Enschede, NL Verify that MODSERIAL is working again.
Revision 0:d777b0d1b461, committed 2016-09-12
- Comitter:
- megrootens
- Date:
- Mon Sep 12 15:00:59 2016 +0000
- Commit message:
- Verify that MODSERIAL is working again.
Changed in this revision
diff -r 000000000000 -r d777b0d1b461 MODSERIAL.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Mon Sep 12 15:00:59 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MODSERIAL/#4737f8a5b018
diff -r 000000000000 -r d777b0d1b461 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 12 15:00:59 2016 +0000 @@ -0,0 +1,38 @@ +/** + * Quick check to verify that indeed MODSERIAL is working again. + */ + +#include "mbed.h" +#include "MODSERIAL.h" + +#define SERIAL_BAUD 115200 + +MODSERIAL pc(USBTX,USBRX); +DigitalOut led(LED_RED); + +// period with which Foo() is to be called +const float kPeriodFoo = 1.0f; + +/** + * Foo function. + * @ensure foobar. + */ +void Foo() +{ + led = !led; + pc.printf("led is %s\r\n",led?"OFF":"ON"); +} + +/** + * Main function. + */ +int main() +{ + pc.baud(SERIAL_BAUD); + pc.printf("\r\n**RESET**\r\n"); + + Ticker tick_foo; + tick_foo.attach(&Foo,kPeriodFoo); + + while (true); +} \ No newline at end of file
diff -r 000000000000 -r d777b0d1b461 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Sep 12 15:00:59 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/2e9cc70d1897 \ No newline at end of file