コード例 #1
0
ファイル: light.c プロジェクト: Phirxian/rug-warrior
/**
 * 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
ファイル: follow_light.c プロジェクト: Mateos81/rug-warrior
void main()
{
    light_environnement();
    init_motors();
    _motor_initial_speed_ = 50;
    _mode_light_ = GO_LIGHT;
    go_light_touch();
}
コード例 #3
0
ファイル: ligth_stop.c プロジェクト: Mateos81/rug-warrior
void main()
{
    init_motors();
    _mode_light_ = GO_LIGHT;
    light_environnement();
    _motor_initial_speed_ = 50;
    go_light_stop(20);
}