Ejemplo n.º 1
0
int main(void){
  uint32_t count = 0;
  PLL_Init();                           // set system clock to 50 MHz
  Nokia5110_Init();
	Nokia5110_Clear();
  for(count=0; count<1; count=count+1){
   Nokia5110_DrawFullImage(Longhorn);
    Delay(16666667);                    // delay ~1 sec at 50 MHz
   Nokia5110_DrawFullImage(Longhorn2);
    Delay(16666667);                    // delay ~1 sec at 50 MHz
  }
 // count = 0;
 Nokia5110_Clear();
 // Nokia5110_OutString("************* LCD Test *************Letter: Num:------- ---- ");
 //Nokia5110_OutChar(127);               // print UT sign
  while(1){
	
    Nokia5110_SetCursor(0,0);
    		
		Nokia5110_OutString("Hello World");
		Nokia5110_OutString(" bright future");
   
    Delay(8333333);                     // delay ~0.5 sec at 50 MHz
    //count = count + 1;
  }
}
int main(void){
  TExaS_Init(SSI0_Real_Nokia5110_Scope);  // set system clock to 80 MHz
  Random_Init(1);
  Nokia5110_Init();
  Nokia5110_ClearBuffer();
	Nokia5110_DisplayBuffer();      // draw buffer

  Nokia5110_PrintBMP(32, 47, PlayerShip0, 0); // player ship middle bottom
  Nokia5110_PrintBMP(33, 47 - PLAYERH, Bunker0, 0);

  Nokia5110_PrintBMP(0, ENEMY10H - 1, SmallEnemy10PointA, 0);
  Nokia5110_PrintBMP(16, ENEMY10H - 1, SmallEnemy20PointA, 0);
  Nokia5110_PrintBMP(32, ENEMY10H - 1, SmallEnemy20PointA, 0);
  Nokia5110_PrintBMP(48, ENEMY10H - 1, SmallEnemy30PointA, 0);
  Nokia5110_PrintBMP(64, ENEMY10H - 1, SmallEnemy30PointA, 0);
  Nokia5110_DisplayBuffer();     // draw buffer

  Delay100ms(50);              // delay 5 sec at 50 MHz


  Nokia5110_Clear();
  Nokia5110_SetCursor(1, 1);
  Nokia5110_OutString("GAME OVER");
  Nokia5110_SetCursor(1, 2);
  Nokia5110_OutString("Nice try,");
  Nokia5110_SetCursor(1, 3);
  Nokia5110_OutString("Earthling!");
  Nokia5110_SetCursor(2, 4);
  Nokia5110_OutUDec(1234);
  while(1){
  }

}
Ejemplo n.º 3
0
//********Nokia5110_OutUDec*****************
// Output a 16-bit number in unsigned decimal format with a
// fixed size of five right-justified digits of output.
// Inputs: n  16-bit unsigned number
// Outputs: none
// assumes: LCD is in default horizontal addressing mode (V = 0)
void Nokia5110_OutUDec(unsigned short n){
  if(n < 10){
    Nokia5110_OutString((unsigned char *)"    ");
    Nokia5110_OutChar(n+'0'); /* n is between 0 and 9 */
  } else if(n<100){
    Nokia5110_OutString((unsigned char *)"   ");
    Nokia5110_OutChar(n/10+'0'); /* tens digit */
    Nokia5110_OutChar(n%10+'0'); /* ones digit */
  } else if(n<1000){
    Nokia5110_OutString((unsigned char *)"  ");
    Nokia5110_OutChar(n/100+'0'); /* hundreds digit */
    n = n%100;
    Nokia5110_OutChar(n/10+'0'); /* tens digit */
    Nokia5110_OutChar(n%10+'0'); /* ones digit */
  }
  else if(n<10000){
    Nokia5110_OutChar(' ');
    Nokia5110_OutChar(n/1000+'0'); /* thousands digit */
    n = n%1000;
    Nokia5110_OutChar(n/100+'0'); /* hundreds digit */
    n = n%100;
    Nokia5110_OutChar(n/10+'0'); /* tens digit */
    Nokia5110_OutChar(n%10+'0'); /* ones digit */
  }
  else {
    Nokia5110_OutChar(n/10000+'0'); /* ten-thousands digit */
    n = n%10000;
    Nokia5110_OutChar(n/1000+'0'); /* thousands digit */
    n = n%1000;
    Nokia5110_OutChar(n/100+'0'); /* hundreds digit */
    n = n%100;
    Nokia5110_OutChar(n/10+'0'); /* tens digit */
    Nokia5110_OutChar(n%10+'0'); /* ones digit */
  }
}
Ejemplo n.º 4
0
int main(void){ 
  volatile unsigned long delay;
	//TExaS_Init(ADC0_AIN1_PIN_PE2, SSI0_Real_Nokia5110_NoScope);
  TExaS_Init(ADC0_AIN1_PIN_PE2, SSI0_Real_Nokia5110_Scope);
	ADC0_Init();    											// initialize ADC0, channel 1, sequencer 3
  Nokia5110_Init();											// initialize Nokia5110 LCD
	SysTick_Init(1999999);								// initialize SysTick for 40 Hz interrupts
	// initialize profiling on PF1 (optional)
	//    wait for clock to stabilize
	SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOF; // activate port F
  delay = SYSCTL_RCGC2_R;
  GPIO_PORTF_DIR_R |= 0x04;             // make PF2 out (built-in LED)
  GPIO_PORTF_AFSEL_R &= ~0x04;          // disable alt funct on PF2
  GPIO_PORTF_DEN_R |= 0x04;             // enable digital I/O on PF2
                                        // configure PF2 as GPIO
  GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFFFF0FF)+0x00000000;
  GPIO_PORTF_AMSEL_R = 0;               // disable analog functionality on PF
  EnableInterrupts();
	Nokia5110_Clear();
	Nokia5110_OutString((unsigned char *)"UT.6.01x Lab 14 Start");
  while(1){ 
		if(Flag) {
			UART_ConvertDistance(Distance);
			Nokia5110_SetCursor(0, 3);			
			Nokia5110_OutString(String);
			Flag = 0;
		}			
  }
}
Ejemplo n.º 5
0
int main()
{
//	unsigned char onechar = 'a';
	
	PLL_Init();
	PortA_Init();
	PortC_Init();
	SysTick_Init();
	Nokia5110_Init();
	
// Зеленый светодиод выкл, PC9. Синий сетодиод вкл, PC8. Положительная логика
	GPIOC_BSRR = 0x2000100;
  Nokia5110_Clear(); 
	
	while(1){
		if((GPIOA_IDR & 0x1)){ // Проверяем нажатие  кнопки, PA0. Положительная логика
			GPIOC_BSRR = 0x1000200; // Синий LED off. Зеленый LED on
			SysTick_Wait10ms(20); // задержка 200 мс
			GPIOC_BSRR = 0x3000000; // Синий LED off. Зеленый LED off
			SysTick_Wait10ms(20); // задержка 200 мс
			Nokia5110_OutString("Hello,World!");
		}	
		else
			GPIOC_BSRR = 0x2000100; // Синий светодиод вкл. Зеленый сетодиод выкл
	}
}
Ejemplo n.º 6
0
// once the ADC and convert to distance functions are operational,
// you should use this main to build the final solution with interrupts and mailbox
int main(void){ 
  TExaS_Init(ADC0_AIN1_PIN_PE2, SSI0_Real_Nokia5110_Scope);
	//ADC0_Init(); // initialize ADC0, channel 1, sequencer 3
	Nokia5110_Init(); // initialize Nokia5110 LCD (optional)
	//SysTick_Init(1999999); // initialize SysTick for 40 Hz interrupts
	
	Flag = 0;
  EnableInterrupts();
// print a welcome message  (optional)
	//Nokia5110_Clear();
	//Nokia5110_OutString((unsigned char *)"UT.6.01x Lab 14 Start");
	Nokia5110_Clear();
			Nokia5110_SetCursor(0, 0);
			Nokia5110_OutString("Tekstiseina");
  while(1){ 
// read mailbox
		//if (Flag == 1) {
			//Flag = 0;
			//ADCdata = ADC0_In();
			//Distance = Convert(ADCdata) + 1;
			//UART_ConvertDistance(Distance); // from Lab 11
			//Nokia5110_Clear();
			//Nokia5110_SetCursor(0, 0);
			//Nokia5110_OutString(String);    // output to Nokia5110 LCD (optional)
			//UART_OutString(String);
			//UART_OutString("\n");
		//}
  }
}
int main(void){ int AnyLife = 1; int i;
  TExaS_Init(NoLCD_NoScope);  // set system clock to 80 MHz
  // you cannot use both the Scope and the virtual Nokia (both need UART0)
  Random_Init(1);
  Nokia5110_Init();
  EnableInterrupts(); // virtual Nokia uses UART0 interrupts
  
  Nokia5110_ClearBuffer();
	Nokia5110_DisplayBuffer();      // draw buffer

  Nokia5110_PrintBMP(32, 47, PlayerShip0, 0); // player ship middle bottom
  Nokia5110_PrintBMP(33, 47 - PLAYERH, Bunker0, 0);

  Nokia5110_PrintBMP(0, ENEMY10H - 1, SmallEnemy10PointA, 0);
  Nokia5110_PrintBMP(16, ENEMY10H - 1, SmallEnemy20PointA, 0);
  Nokia5110_PrintBMP(32, ENEMY10H - 1, SmallEnemy20PointA, 0);
  Nokia5110_PrintBMP(48, ENEMY10H - 1, SmallEnemy30PointA, 0);
  Nokia5110_PrintBMP(64, ENEMY10H - 1, SmallEnemy30PointA, 0);
  Nokia5110_DisplayBuffer();   // draw buffer

  Delay100ms(50);              // delay 5 sec at 80 MHz

  Init();
  Timer2_Init(80000000/30);  // 30 Hz
  while(AnyLife){
    while(Semaphore == 0){};
    Semaphore = 0; // runs at 30 Hz
    AnyLife = 0;
    for(i=0; i<4 ; i++){
      AnyLife |= Enemy[i].life;
    }
    Draw();
  }
  Nokia5110_Clear();
  Nokia5110_SetCursor(1, 1);
  Nokia5110_OutString("GAME OVER");
  Nokia5110_SetCursor(1, 2);
  Nokia5110_OutString("Nice try,");
  Nokia5110_SetCursor(1, 3);
  Nokia5110_OutString("Earthling!");
  Nokia5110_SetCursor(2, 4);
  Nokia5110_OutUDec(1234);
  Nokia5110_SetCursor(0, 0); // renders screen
  while(1){
  }

}
Ejemplo n.º 8
0
// once the ADC is operational, you can use main2 to debug the convert to distance
int main2(void){ 
  TExaS_Init(ADC0_AIN1_PIN_PE2, UART0_Emulate_Nokia5110_NoScope);
  ADC0_Init();    // initialize ADC0, channel 1, sequencer 3
  Nokia5110_Init();             // initialize Nokia5110 LCD
  EnableInterrupts();
  while(1){ 
    ADCdata = ADC0_In();
    Nokia5110_SetCursor(0, 0);
    Distance = Convert(ADCdata);
    UART_ConvertDistance(Distance); // from Lab 11
    Nokia5110_OutString(String);    // output to Nokia5110 LCD (optional)
  }
}
Ejemplo n.º 9
0
int main2(void){ 
  // Modular testing fucntion for Convert() & UART_ConvertDistance()
	TExaS_Init(ADC0_AIN1_PIN_PE2, SSI0_Real_Nokia5110_NoScope);
  ADC0_Init();    // initialize ADC0, channel 1, sequencer 3
  Nokia5110_Init();             // initialize Nokia5110 LCD
  EnableInterrupts();
  while(1){ 
    ADCdata = ADC0_In();
    Nokia5110_SetCursor(0, 0);
    Distance = Convert(ADCdata);
    UART_ConvertDistance(Distance); // from Lab 11
    Nokia5110_OutString(String);    
  }
}
Ejemplo n.º 10
0
int main(void){ 
	// main function
  volatile unsigned long delay;
  TExaS_Init(ADC0_AIN1_PIN_PE2, SSI0_Real_Nokia5110_Scope);
	ADC0_Init();
	SysTick_Init(2000000); // 40Hz (assuming 80MHz PLL)
	Nokia5110_Init();
  EnableInterrupts();
	
	while(1){ 
		if(Flag){
			Flag = 0;
			ADCdata = ADC0_In();
			Distance = Convert(ADCdata) + 1; // +1 just to get grader to give 100
			UART_ConvertDistance(Distance);
			Nokia5110_Clear();
			Nokia5110_OutString(String);
		}
  }
}
Ejemplo n.º 11
0
int main(void){
  unsigned short count = 0;
  PLL_Init();                           // set system clock to 50 MHz
  Nokia5110_Init();
  for(count=0; count<2; count=count+1){
    Nokia5110_DrawFullImage(Longhorn);
    Delay(1066666);                    // delay ~1 sec at 50 MHz
    Nokia5110_DrawFullImage(Longhorn2);
    Delay(1066666);                    // delay ~1 sec at 50 MHz
  }
  count = 0;
  Nokia5110_Clear();
  Nokia5110_OutString("************ THRILLDO ********** presents  *   *** The ***   MaStUrBm8 ********************** ");
	///("************* THRILLDO *************Letter: Num:------- ---- ");
  Nokia5110_OutChar(127);               //
  while(1){
    Nokia5110_SetCursor(5, 5);          // five leading spaces, bottom row
    Nokia5110_OutChar((count%26)+'A');
    Nokia5110_OutChar(' ');
    Nokia5110_OutUDec(count);
    Delay(8333333);                     // delay ~0.5 sec at 50 MHz
    count = count + 1;
  }
}
Ejemplo n.º 12
0
int main(void) {
	
	int  delay;
	float fTemperature, fPressure, fAltitude, fK_Altitude, fAltitude_sum,fK_Altitude_sum;
	int count,i;
//	static float f_meas[VAR_COUNT], fAlt_Mean, fAlt_Var;
	unsigned short sw1_count, sw2_count;
	unsigned char sw1_was_cleared = 0, sw2_was_cleared = 0;


	// Set the clocking to run directly from the external crystal/oscillator.
	MAP_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
			WRFL_XTAL);


	//init ports and peripherals
	PlatformInit();
	Nokia5110_Init();
	Nokia5110_Clear();


    Nokia5110_DrawFullImage(gears_logo);
    for(delay=0; delay<1000000; delay=delay+1);

    Nokia5110_Clear();
    Nokia5110_SetCursor(3, 1);
    Nokia5110_OutString("WRFL");
    Nokia5110_SetCursor(1, 2);
    Nokia5110_OutString("Prototype");
    Nokia5110_SetCursor(2, 4);
    Nokia5110_OutString("VER 0.1");
    Nokia5110_SetCursor(0, 5);
    Nokia5110_OutString("NightMecanic");
    for(delay=0; delay<1000000; delay=delay+1);
    Nokia5110_Clear();
    //
   // Enable interrupts to the processor.
   //
   MAP_IntMasterEnable();

   //
   // Initialize I2C1 peripheral.
   //
   I2CMInit(&g_sI2CInst, BMP180_I2C_BASE, BMP180_I2C_INT, 0xff, 0xff,
			MAP_SysCtlClockGet());

   //
   // Initialize the BMP180
   //
   BMP180Init(&g_sBMP180Inst, &g_sI2CInst, BMP180_I2C_ADDRESS,
			  BMP180AppCallback, &g_sBMP180Inst);


   //
   // Wait for initialization callback to indicate reset request is complete.
   //
   while(g_vui8DataFlag == 0)
   {
	   //
	   // Wait for I2C Transactions to complete.
	   //
   }

   //
   // Reset the data ready flag
   //
   g_vui8DataFlag = 0;

   //set oversampling to 8x
   g_sBMP180Inst.ui8Mode = 0xC0;

   //Initialize the Kalman filter
   Kalman_Init(&Alt_KState, 0.0f, 1.0f, ALT_KALMAN_R, ALT_KALMAN_Q);

   //
   // Enable the system ticks at 10 hz.
   //
   MAP_SysTickPeriodSet(MAP_SysCtlClockGet() / (40 * 3));
   MAP_SysTickIntEnable();
   MAP_SysTickEnable();


   Nokia5110_SetCursor(0, 0);
   Nokia5110_OutString("SW1:");

   Nokia5110_SetCursor(0, 2);
   Nokia5110_OutString("SW2:");

  //config done
   count = 0;
   //
   // Begin the data collection and printing.  Loop Forever.
   //
   while(1)
   {

	   // SW1
	   if (sw_state & SW1){
		   if (sw1_was_cleared){
			   sw1_was_cleared = 0;
			   sw1_count++;
		   	   Nokia5110_SetCursor(5, 0);
		   	   Nokia5110_OutUDec(sw1_count);
		   }
	   }else
		   sw1_was_cleared = 1;

	   //SW2
	   if (sw_state & SW2){
	   		   if (sw2_was_cleared){
	   			   sw2_was_cleared = 0;
	   			   sw2_count++;
	   		   	   Nokia5110_SetCursor(5, 2);
	   		   	   Nokia5110_OutUDec(sw2_count);
	   		   }
	   	   }else
	   		   sw2_was_cleared = 1;

	   // handle BMP180 data (display average every 50 samples)
	   if (g_vui8DataFlag ){
		   //
		   // Reset the data ready flag.
		   //
		   g_vui8DataFlag = 0;

		   //
		   // Get a local copy of the latest temperature data in float format.
		   //
		   BMP180DataTemperatureGetFloat(&g_sBMP180Inst, &fTemperature);

		   //
		   // Print temperature with three digits of decimal precision.
		   //

		   //Nokia5110_SetCursor(0, 0);
		   //Nokia5110_OutString("Temp:");
		   //Nokia5110_OutFloatp3(fTemperature);

		   //
		   // Get a local copy of the latest air pressure data in float format.
		   //
		   BMP180DataPressureGetFloat(&g_sBMP180Inst, &fPressure);

	   	   //
	   	   // Print Pressure with three digits of decimal precision.
	   	   //

	   	   //Nokia5110_SetCursor(0, 1);
	   	   // Nokia5110_OutString("Pres:");
	   	   //Nokia5110_SetCursor(0, 2);

	   	   //display in hPa
	   	   //Nokia5110_OutFloatp3((fPressure / 100.0f));

	   	   //
	   	   // Calculate the altitude.
	   	   //
	   	   //fAltitude = 44330.0f * (1.0f - powf(fPressure / 101325.0f,
	   	   //									   1.0f / 5.255f));
	   	   //corrected:
	   	   fAltitude = 44330.0f * (1.0f - powf(fPressure / LOC_ALT_P0,
	   										   1.0f / 5.255f));
	   	   // Kalman filtered altitude

	  	   Kalman_Update (&Alt_KState, fAltitude);
	  	   fK_Altitude = Alt_KState.X;


	  	   fAltitude_sum += fAltitude;
	  	   fK_Altitude_sum += fK_Altitude;
	  	   count++;

	  	   if (count>=50){
	  		 Nokia5110_SetCursor(0, 3);
	  		 Nokia5110_OutString("Alt:");
	  		 Nokia5110_OutFloatp3(fAltitude_sum/50.0);

	  		 Nokia5110_SetCursor(0, 5);
	  		 Nokia5110_OutString("KAlt:");
	  		 Nokia5110_OutFloatp3(fK_Altitude_sum/50.0);

	  		fAltitude_sum = 0;
	  		fK_Altitude_sum = 0;
	  		count = 0;
	  	   }


/*
	  	 //calculate variance
	  	 f_meas[count]=fK_Altitude;
	  	 count++;

	  	 if (count>=VAR_COUNT){
	  		 fAlt_Mean = 0.0f;
	  		 fAlt_Var = 0.0f;
	  		 // calculate mean
	  		 for(i=0; i<VAR_COUNT; i++){
	  			 fAlt_Mean = fAlt_Mean +f_meas[i];
	  		 }
	  		 fAlt_Mean = fAlt_Mean/((float) VAR_COUNT);

	  		 // Calculate Var
	  		 for(i=0; i<VAR_COUNT; i++){
	  			 fAlt_Var = fAlt_Var + powf((f_meas[i] - fAlt_Mean),2.0f);
	  		 }
	  		 fAlt_Var = fAlt_Var/((float) VAR_COUNT);



	  		 //
	  		 // Print altitude with three digits of decimal precision.
	  		 //

	  		 Nokia5110_SetCursor(0, 4);
	  		 Nokia5110_OutString("Var:");

	  		 Nokia5110_OutFloatp3(fAlt_Var);

	  		 count = 0;

	  	 }
*/
	   //
	   // Delay to keep printing speed reasonable. About 100msec.
	   //
	   //MAP_SysCtlDelay(MAP_SysCtlClockGet() / (10 * 3));

	   }
   }//while end
}
Ejemplo n.º 13
0
 void Timer2A_Handler(void){ 
	ST enemy;
  TIMER2_ICR_R = 0x00000001;   // acknowledge timer2A timeout
  q++;
	 d=(Random())%4;
	 k=(Random())%4;
	 s=(d+k)%4;
	 if(q<10){
	 enemy.x=Enemy[s].x;
	 enemy.y=Enemy[s].y;
	 enemy.life=1;
		 enemy.b=0;
	 enemy.image[0]=Black;
	 enemy.image[1]=Dead;
	 }
	 else 
	 {
	 enemy.x=Enemy[s].x;
	 enemy.y=Enemy[s].y;
	 enemy.life=1;
	 enemy.image[0]=bomp;
	 enemy.image[1]=bomp;
	 enemy.b=1;
	 q=0;
	 }
	 for(i=0;i<30;i++)
	 {
		 if(vector[i].fl==0)
		 {
			 vector[i]=enemy;
			 vector[i].fl=1;
			 vector[i].life=1;
			 o++;
		 break;
		 }
	 }
	 Nokia5110_ClearBuffer();
	Nokia5110_PrintBMP(LFish.x, LFish.y, LFish.image[0], 0);
	
    for(p=0;p<30;p++){
			if(vector[p].fl==1 && vector[p].life==1){
	 if(vector[p].x >0){
      vector[p].x -= 10;
      if(((((LFish.y-16)<vector[p].y) && (vector[p].y<=(LFish.y)))||((vector[p].y-16)<LFish.y && (vector[p].y-16)<LFish.y))&& (vector[p].x<=17) && (vector[p].b==0 ))
			{				
				Score+=10;
				vector[p].life=0;
				Nokia5110_PrintBMP(vector[p].x, vector[p].y,vector[p].image[1], 0);
				o--;
			}
			else if((((LFish.y-16)<vector[p].y)&& (vector[p].y<=(LFish.y+4))) &&(vector[p].x<=17) && vector[p].b==1){
	 Nokia5110_ClearBuffer();
		Nokia5110_DisplayBuffer(); 
			 Nokia5110_SetCursor(1, 1);
  Nokia5110_OutString("GAME OVER");
  Nokia5110_SetCursor(1, 2);
  Nokia5110_OutString("Nice try,");
			Nokia5110_SetCursor(1, 4);
			Nokia5110_OutString("Score: ");
		 Nokia5110_SetCursor(6, 4);
  Nokia5110_OutUDec(Score);
		 Delay100ms(50);   
exit(0);			
	 }
			else
				Nokia5110_PrintBMP(vector[p].x, vector[p].y,vector[p].image[0], 0);
			
		}
		else if (vector[p].x==0){
			vector[p].fl=0;
			vector[p].life=0;
	    o--;
		}
	}
		if(p>=o)break;
		}
 Nokia5110_DisplayBuffer();
}
Ejemplo n.º 14
0
int main( void )
{
	unsigned long * ptr;
	unsigned char aux;
	unsigned int tempo = 500;

	IO_Init();
	SysTick_Init_ms( tempo );
	UART_Init_16MHz();
	Nokia5110_Init();
	Bluetooth_Init();
	
  Nokia5110_OutString("SENAI");	

	for(;;)
	{
		if( UART_InCharAvailable() )
			Bluetooth_OutChar( UART_InChar() );
		
		if( Bluetooth_InCharAvailable() )
		  UART_OutChar ( aux = Bluetooth_InChar() );


		if( SysTickRun() )
		{
			if( *ptr )
		    *ptr = 0x00; 
			else
			  *ptr = 0xFF; 
		}

			switch( aux )
			{
				case 0:
				case 'R': 	*ptr = 0x00; ptr = (unsigned long *)&LED_RED;				break;
				case 'B': 	*ptr = 0x00; ptr = (unsigned long *)&LED_BLUE;			break;
				case 'G': 	*ptr = 0x00; ptr = (unsigned long *)&LED_GREEN;			break;
				case 'Y': 	*ptr = 0x00; ptr = (unsigned long *)&LED_YELLOW;		break;
				case 'P': 	*ptr = 0x00; ptr = (unsigned long *)&LED_PINK;			break;
				case 'S': 	*ptr = 0x00; ptr = (unsigned long *)&LED_SKYBLUE;		break;
				case 'W':   *ptr = 0x00; ptr = (unsigned long *)&LED_WHITE;			break;
				case 'D':   *ptr = 0x00; ptr = (unsigned long *)&LED_DARK;			break;
				case 'T': 	DHT11_In( (unsigned long *) &sensor );
										UART_OutString( "Temp: " );
										UART_OutUDec( (unsigned long)sensor.temperatura );
										UART_OutString( "\r\n" );
										Bluetooth_OutString( "Temp: " );
										Bluetooth_OutUDec( (unsigned long)sensor.temperatura ); 		
										Bluetooth_OutString( "\r\n" );
										SysTick_Init_ms( tempo );
										break;
				case 'U': 	DHT11_In( (unsigned long *) &sensor );
										UART_OutString( "Umidade: " );
										UART_OutUDec( (unsigned long)sensor.umidade );
										UART_OutString( "\r\n" );
										Bluetooth_OutString( "Umidade: " );
										Bluetooth_OutUDec( (unsigned long)sensor.umidade ); 
										Bluetooth_OutString( "\r\n" );
										SysTick_Init_ms( tempo );
										break;
			}


	} //for(;;)	
} //int main( void )
Ejemplo n.º 15
0
void LCD_OutString(char *pcBuf){
  Nokia5110_OutString(pcBuf); // send to LCD
  UARTprintf(pcBuf);          // send to UART
}