mobile robot control with artificial hormones

Dependencies:   Communication_Robot RTC-DS1307 iSerial mbed

Fork of Andante_v00 by potiwat ngamkajornwiwat

main.cpp

Committer:
soulx
Date:
2015-03-01
Revision:
2:b31c4677ebc0
Parent:
0:95d17607a698
Child:
3:12f2ee26a43f

File content as of revision 2:b31c4677ebc0:

#include "mbed.h"
#include "param.h"
#include "pin_config.h"

#include "iSerial.h"
//#include "protocol.h"
#include "communication.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()
{
    COMMUNICATION pan_a(TX_PAN_A, RX_PAN_A,115200,1000,1000); // tx, rx
    COMMUNICATION pan_b(TX_PAN_B, RX_PAN_B,115200,1000,100); // tx, rx

}

void setControl()
{

}

void getSensor()
{

}

void Init_foreground()
{
    Update_command.attach(&setControl,TIMER_UPDATE);
    Samping.attach(&getSensor,TIMER_SAMPING);
}







int main()
{
    Init_communication();
    Init_servo();

    //pan_a.CommunicatePacket
}