Exemplo n.º 1
0
int main(void)
{
	
	ConfigPins();
	initUART();
	initSysTick();	
	RValue = initAccel();	
	printInteger(RValue);
	if (RValue == 0) {
		printString("Boldly going :)\r\n");
	} else {
		printString("Inertia sensors offline :(\r\n");
	}
	while (1) { 		
		Temperature = getTemperature();		
		printShort(Temperature);		
		printString(" ");					
		getMotion(&m);
		printShort(m.x_a);		
		printString(" ");
		printShort(m.y_a);		
		printString(" ");
		printShort(m.z_a);		
		printString(" ");		
		printString("\r\n");				
		GPIO0DATA ^= BIT2;				
		delay(10000);
	}

	return 0;
}
int main(void) 
{
   SetClock();
   ConfigPins();
   SetBaud();
   UARTCharPut(UART0_BASE, 'H');
   UARTCharPut(UART0_BASE, 'I');
    
    while (1)
    {
    	CheckReceivedBits();
    	
	}

}
Exemplo n.º 3
0
int main()
{	
	
	ConfigPins();
	int i=5000;	
	while(1) 
	{
	
		DisplayNumber(i--);
		RefreshDisplay();
		if (i < 0)
			i=5000;
		
	}    
}
Exemplo n.º 4
0
int main()
{	
	
	ConfigPins();
	initUART();
	int rx_byte = 0;
	printString("Press L to turn on the LED, M to turn off\r\n");
	while(1) 
	{
	
/*	    rx_byte=egetc();  // read an incoming byte (waits for input)            
	    switch (rx_byte)
		{
			case  'L' : {
				GPIO0DATA |= BIT2;break; // Set port bit high
			}
			case 'M' : {
				GPIO0DATA &= ~BIT2;break; // Set port bit low
			}
		}	    
	    delay(100);	    
	    eputc(rx_byte);     //transmit switch_word
*/
		WaitForBtnPress();
		WaitForBtnRelease();
		if(rx_byte % 2 == 0)
		{
			printString("L");
		}//end if
		else
		{
			printString("M");
		}//end else
		rx_byte++;
	}    
}