tetsuya Ogata
/
Enpra_practice06
Revision 0:c6fc29c5ecd0, committed 2013-05-29
- Comitter:
- ogata_lab
- Date:
- Wed May 29 13:03:46 2013 +0000
- Commit message:
- first commit
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TA8428.lib Wed May 29 13:03:46 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/ogata_lab/code/TA8428/#655b0ede301b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 29 13:03:46 2013 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "TA8428.h" + +DigitalIn sw01(p19); +TA8428 driver(p21, p22); + +bool old_sw = false; +bool direction_cw = true; + +int main() { + while(1) { + bool new_sw = sw01 == 0; + if (!old_sw && new_sw) { + direction_cw = !direction_cw; + } + old_sw = new_sw; + + if (direction_cw) { + driver.drive(0.5); + } else { + driver.drive(-0.5); + } + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed May 29 13:03:46 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17 \ No newline at end of file