Junichi Katsu
/
wallbot_test
It is a test program of wallbot library.
Revision 0:ce9fda861f9e, committed 2013-07-28
- Comitter:
- jksoft
- Date:
- Sun Jul 28 08:21:57 2013 +0000
- Commit message:
- First
Changed in this revision
diff -r 000000000000 -r ce9fda861f9e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jul 28 08:21:57 2013 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "wallbot.h" + +wallbot wb; + +BusOut leds(LED1,LED2,LED3,LED4); + +int main() { + + wait(0.5); + + // Motor test. + wb.forward(0.5); + wait (2.0); + wb.left(0.5); + wait (2.0); + wb.backward(0.5); + wait (2.0); + wb.right(0.5); + wait (2.0); + + wb.stop(); + + // Sensor & Switch test. + while(1) + { + int bit; + wb.GetLinePosition(&bit); + printf("LeftSw:%d RightSw:%d FloorSensor:%X\r\n",wb.GetLeftSw(),wb.GetRightSw(),bit); + leds = bit; + wait(0.1); + } + } \ No newline at end of file
diff -r 000000000000 -r ce9fda861f9e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jul 28 08:21:57 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17 \ No newline at end of file
diff -r 000000000000 -r ce9fda861f9e wallbot.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wallbot.lib Sun Jul 28 08:21:57 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/jksoft/code/wallbot/#f8571ffd252a