mobile robot control with artificial hormones
Dependencies: Communication_Robot RTC-DS1307 iSerial mbed
Fork of Andante_v00 by
main.cpp
- Committer:
- soulx
- Date:
- 2015-02-28
- Revision:
- 0:95d17607a698
- Child:
- 2:b31c4677ebc0
File content as of revision 0:95d17607a698:
#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(); }