示例#1
0
/**
 * Running to 20cm of ligth
 * but escape obstacle with bumpers
 */
void go_light_stop_touch()
{
    int bmp;

    _mode_light_ = GO_LIGHT;
    _motor_initial_speed_ = 100;

    light_environnement();
    start_process(go_light_stop(20));

    while(_go_light_touch_running_)
    {
        bmp = bumper_detection();

        if(bmp != 0 && (bmp != BMP_BACK))
        {
            stop_process(_go_light_stop_running_);
            wait_process(_go_light_stop_running_);
            escape(bmp);
            start_process(go_light_stop(20));
        }
    }

    stop_process(_go_light_stop_running_);
    wait_process(_go_light_stop_running_);
    _go_light_touch_running_ = -1;
}
示例#2
0
void main()
{
    light_environnement();
    init_motors();
    _motor_initial_speed_ = 50;
    _mode_light_ = GO_LIGHT;
    go_light_touch();
}
示例#3
0
void main()
{
    init_motors();
    _mode_light_ = GO_LIGHT;
    light_environnement();
    _motor_initial_speed_ = 50;
    go_light_stop(20);
}