예제 #1
0
int main(void){
	int useless =0;
	int a,b,c;
	
	DisableInterrupts(); 
	PLL_Init();      // 50 MHz I think?
	LCD_Open();
	ADC_InitSWTriggerSeq3(3);
	SysTick_Init();
  SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOG; // activate port G
	useless = 1;
	useless =0;
  GPIO_PORTG_DIR_R |= 0x04;             // make PG2 out (built-in LED)
  GPIO_PORTG_AFSEL_R &= ~0x04;          // disable alt func on PG2
  GPIO_PORTG_DEN_R |= 0x04;             // enable digital I/O on PG2
  PG2 = 0;                              // turn off LED
	UART_Init();
	ADC_Init();
	LCD_Clear();
	EnableInterrupts();
	
	


while(1)
{
	

	if((FIFO_Get() !=1) && getmail==0x2)
	{
		
		
	int i;
	int sendme;
		flag =0;
		//FIFO_Get();
		LCD_GoTo(0);
	for(i = 0; i <5; i++)
		{
			FIFO_Get();
			sendme = getmail;
			LCD_OutChar( sendme);
		}
		LCD_GoTo(20);
		LCD_OutChar(99);
		LCD_OutChar(109);
		FIFO_Get();
		FIFO_Get();	// these two gets just take the blank space and the Stop 0x03 off the FIFO
		
	}	
}
	
}
예제 #2
0
파일: ADC.c 프로젝트: JDongian/EE319k
void ADC_Init(void){
  ADC_InitSWTriggerSeq3(2);             // allow time to finish activating
  Timer0B_Init10HzInt();                // set up Timer0A for 10 Hz interrupts
	//Timer1B_Init10HzInt();                // set up Timer0A for 10 Hz interrupts
}