void klaw_kont() { int POS = 0; int C_5 = 'vexRT[Ch5]'; int C_6 = 'vexRT[Ch6]'; if ( C_5 == 127 ) { if ( POS <= 1 ) { POS++; motor[port3] = 40; motor[port4] = 40; wait1Msec(1000); } } else if ( C_5 == -127 ) { if ( POS >= 1 ) { POS--; motor[port3] = -40; motor[port4] = -40; wait1Msec(1000); } } else if ( C_6 == 127 ) { if ( POS == 0 ) { POS++; POS++; motor[port3] = 40; motor[port4] = 40; wait1Msec(2000); } } else if ( C_6 == -127 ) { if ( POS == 2 ) { POS--; POS--; motor[port3] = -40; motor[port4] = -40; wait1Msec(2000); } } task main() { while (true) { set_cont(); klaw_kont(); } } }
void signal_handler(int signo) { int errno_save; errno_save = errno; switch(signo) { case SIGINT: set_cont(0); break; case SIGUSR1: set_dump(1); break; case SIGUSR2: set_dump_if_list(1); break; case SIGHUP: set_reload_cfg(1); break; } errno = errno_save; }