/*************************************************************************
Function: main()
**************************************************************************/
int main(void){
	init_wyvern();
	LED_green_on();
	LED_ucgreen_on();
	char input;
	menuScreen = 'a';
	for( ; ; ){
		printMenu();
		input = '0';
		outgoing.command = input;
		if(DataInReceiveBuffer()){
			input = ReceiveByte();
		}
		getJoystick();
		controllerCommand(input);
		controllerTransmit();
		_delay_ms(5);
	if(incoming.battery < 100){
			LED_red_toggle();
			LED_ucred_toggle();
			LED_blue_toggle();
			LED_yellow_toggle();
			LED_green_toggle();
		}
	}
	return 0;
}
예제 #2
0
파일: xtalfreq.c 프로젝트: beppodb/PowerMon
int main(void) {
    int got;

	MCUSR = 0;
	wdt_disable();

    cli();
    init();
    sei();
    printf("OK\n");
    while(1) {
        if(write == 1) {            
            printf("Frequency = %u\n\r",(unsigned int)last_frequency);
            write = 0;
        } else {
            if(DataInReceiveBuffer()) {
                got = fgetc(stdin);
                if(got == 'P') {
        	        wdt_enable(WDTO_15MS);
                    while(1);             
                }
            }
        }
    }
}