![](/media/cache/group/11700697_10200701668420946_8214886085951071495_o.jpg.50x50_q85.jpg)
mobile robot control with artificial hormones
Dependencies: Communication_Robot RTC-DS1307 iSerial mbed
Fork of Andante_v00 by
Diff: main.cpp
- Revision:
- 0:95d17607a698
- Child:
- 2:b31c4677ebc0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Feb 28 16:25:25 2015 +0000 @@ -0,0 +1,55 @@ +#include "mbed.h" +#include "param.h" +#include "pin_config.h" + +//control stearing +PwmOut heading_front(PIN_FRONT_SERVO); +PwmOut heading_rear(PIN_REAR_SERVO); +//control speed +PwmOut drive_motor(PIN_RC_SPEED); + +//led debugging +DigitalOut myled(LED1); + +//set foreground +Ticker Update_command; +Ticker Samping; + +void Init_servo() +{ + heading_front.period_ms(20); + heading_rear.period_ms(20); + drive_motor.period_ms(20); +} +void Init_communication() +{ + iSerial pan_a(TX_PAN_A, RX_PAN_A); // tx, rx + iSerial pan_b(TX_PAN_B, RX_PAN_B); // tx, rx + + pan_a.baud(115200); + pan_b.baud(115200); + +} + +void Init_foreground() +{ + Update_command.attach(&setControl,TIMER_UPDATE); + Samping.attach(&getSensor,TIMER_SAMPING); +} + +void setControl() +{ + +} + +void getSensor() +{ + +} + +int main() +{ + Init_communication(); + Init_servo(); + +}