コード例 #1
0
ファイル: main.c プロジェクト: AmoliShah/Divyadrishti
int main (void)
{
	uint8_t tiles[6] = {0,0,0,0,0,0}, receivedData,i = 0;
	int quotient;
	system_init();
	ext_usart_clock_init();
	ext_usart_pin_init();
	ext_usart_init();
	configure_console();
	printf("Up and running!\r");
	while (1) {
		receivedData = USART_Receive();
		quotient = receivedData;
		i = 0;
		while(quotient != 0) {
			tiles[i] = quotient%2;
			quotient /= 2;
			i++;
		}
		for(int i = 0; i < 6; i++) {
			printf("%d",tiles[i]);
			tiles[i] = 0;
		}
	printf("\n");
	}
}
コード例 #2
0
ファイル: USART_Commands.c プロジェクト: BrownCubeSat/EQUiSat
void USART_init() {	
	ext_usart_clock_init();
	ext_usart_pin_init();
	ext_usart_init();

	#if PRINT_DEBUG != 0
		// if printing, make sure the USART is not sent to the radio
		setTXEnable(false);
		setRXEnable(false);
	#endif
}