Esempio n. 1
0
int main() {
    check_clock_support();
    init_rand();
    init_speed();
    with_ncurses(gameloop);
    return 0;
}
Esempio n. 2
0
void main()
{
    unsigned short val = 0;
    unsigned int show_data = 0;
    //unsigned short last_data = 0;
    uart2_init();
    init_led();
    init_motor();
    init_steering();
    init_speed();
    show_byte(0);

    //led_vcc_on();
    while(1) {
        //		show_byte(0x12,1);

        if((uart_data >= '0') && (uart_data <= 'z')) {
            //last_data = val;
            val = uart_data;
        }
        //show_data = (cmd_func << 8) | (val & 0xff);
        show_data = ((left_dis << 8)&0xff00) | (right_dis & 0xff);
        //show_data = (left_diff << 8) | (right_diff & 0xff);

        show_byte(show_data);

        if(sg_flag == 1) {
            sg_flag = 0;
            delay1ms_show(1000 * 3,show_data);
            if(sg_flag == 0) { //maybe call up() twice in 3s
                stop_sg();
            }


        }
        //uart2_send('a');
        //uart2_send('b');
        //uart2_send('c');
    }
}