예제 #1
0
int main(void)
{ 
	_delay_ms(2000);
	init();
	initialize_motors();
	
	/* CONVENSION TO RUN THE MOTORS
	=> Set the rotation direction
	=> call the function reach_to_ticks with "final_ticks" and "motor_number" as arguments*/
	while(1)
 	 {
		switch (usart_data)
		{
			case 'a': reset_ticks();flash_on();break;
			case 'b': reset_ticks();flash_off();break;
			case 'c': reset_ticks();ground_left();break;
			case 'd': reset_ticks();ground_right();break;
			case 'e': reset_ticks();ground_front();break;
			case 'f': reset_ticks();ground_reset();break;
			case 'g': reset_ticks();stairs_left();break;
			case 'h': reset_ticks();stairs_right();break;
			case 'i': reset_ticks();stairs_front();break;
			case 'j': reset_ticks();stairs_reset();break;
			case 'k': reset_ticks();break;
			case 'n': reset_ticks();ground_reverse();break;
			case 'o': reset_ticks();stairs_reverse();break;
			default: break;
			
		}
	 }
}
예제 #2
0
파일: startup.c 프로젝트: xumiao-1/AutoLPW
void enter_node_stop(void) {

	// turn off RF
	tat_enter_sleep_mode();
	hal_set_rst_high();
	HAL_SS_HIGH();

	// turn off flash
	//set_spi_flash_state(SPI_FLASH_OFF);
	GPIO_SetBits(GPIOB, PIN_RST);
	GPIO_SetBits(GPIOB, PIN_CS);

	flash_off();

	// testing...
	#ifdef MY_DEBUG
	hal_clear_net_led();
	hal_clear_data_led();
	#endif
	testing();
	RTC_WakeUpCmd(ENABLE);
}