![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
ff
Dependencies: Motor Servo mbed
Diff: main.cpp
- Revision:
- 0:7ad01343cc80
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 23 23:44:06 2015 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "Motor.h" +Motor R(p24, p25, p26); +Motor L(p21, p22, p23); + +int main() +{ + while(1) { + if (sensor= blue) + { + R.speed(0.5); + L.speed(0.5); + } + if (sensor=green) + { + L.speed(0.2); + R.speed(0.0); + } + if (sensor=red) { + L.speed(0.0); + R.speed(0.2);} + }} + + +