Ejemplo n.º 1
0
//write data on eeprom
int CfgCmd(char *inbuffer)
{
	int adresa = 18;
	//char *scriu;
	char comanda[7];

	for (int8_t i = 0; i < 19; ++i)
	{
		strcpy_P(comanda, (char*) pgm_read_word(&(comenzi[i]))); // Necessary casts and dereferencing, just copy.
		if (strstr(inbuffer, comanda) != 0)
		{

			inbuffer += strlen(comanda) + 1;
			adresa = 18 * (2 + i);
#if DEBUG
			//Serial.print("Scriu la adresa ");
			UWriteInt(adresa);
			UWriteString(": ");
			UWriteString(inbuffer);
			UWriteData(0x0D);
			UWriteData(0x0A);
#endif
			eeprom_write_block(inbuffer, (int*) adresa, 18);
			return adresa;
		}
	}
	return 0;
}
Ejemplo n.º 2
0
void pause_Test (void)
{
	Command_Display(Clear_Screen);	
	Command_Display(Go_Home);
	UWriteString(aNumberAsString);	
	Set_Cursor_Position(1,2);
	UWriteString(pause_String);
}
Ejemplo n.º 3
0
void start_Test (void)
{
	Command_Display(Clear_Screen);
	Command_Display(Go_Home);
	UWriteString(start_Screen1);
	Set_Cursor_Position(1,2);
	UWriteString(start_Screen2);
}
Ejemplo n.º 4
0
void update_Display_Count (uint32_t count)
{
	Command_Display(Clear_Screen);	
	Command_Display(Go_Home);
	ltoa(count, aNumberAsString, 10);
	UWriteString(aNumberAsString);	
	Set_Cursor_Position(1,2);
	UWriteString(Label);
}
Ejemplo n.º 5
0
//--------------------------------------------------------------------
int main(void)
{
	char data[16];
	int axe_value=5;
	
	SystemInit(); // system variables and state initialize
	PortInit(); // inputs and outputs initialize
	LIS302DL_init();				// initialize I2C LIS302DL XYZ accelerometer.
	//sei();						// Enable interrupts.

	Command_Display(Clear_Screen);	
	Command_Display(Go_Home);
	itoa(axe_value, data, 10);		//Convert the X value integer into string.
	UWriteString(data);					//Print X value number on LCD.
	Set_Cursor_Position(1,2);
	UWriteString(uTeslas_String);	
	_delay_ms(5000);
    while(1)
    {	
	
		//-------------------------------------------------------------------
		// Read accelerometer and print X,Y,Z axis value on LCD.	
		//-------------------------------------------------------------------
		
		axe_value = LIS302DL_read(outX); //Read X axe value.
		Command_Display(Clear_Screen);	
		Command_Display(Go_Home);
		itoa(axe_value, data, 10);		//Convert the X value integer into string.
		UWriteString(data);					//Print X value number on LCD.  
		Set_Cursor_Position(1,2);
		UWriteString(uTeslas_String);
		
		/*	
		axe_value = LIS302DL_read(outY); //Read Y axe value.
		Command_Display(Clear_Screen);	
		Command_Display(Go_Home);
		itoa(axe_value, data, 10);
		UWriteString(data);
		placeEmptyCharacters(data,4);
		
		Set_Cursor_Position(1,2);
		UWriteString(uTeslas_String);
			
		axe_value = LIS302DL_read(outZ); //Read Z axe value.
		Command_Display(Clear_Screen);	
		Command_Display(Go_Home);
		itoa(axe_value , data, 10);
		UWriteString(data);
		placeEmptyCharacters(data,4);
		
		Set_Cursor_Position(1,2);
		UWriteString(uTeslas_String);
			*/
		_delay_ms(1000);	
    }
}
Ejemplo n.º 6
0
//==================================================================================
// Prints space characters on LCD starting from the last used LCD address.
// This function is used to erase previous printed data on LCD from specific location.
//==================================================================================
void placeEmptyCharacters (char charsNumber[8], unsigned char emptySpacesNumber)
{
	unsigned char length, i;
	length = strlen(charsNumber);
	for(i=0;i<(emptySpacesNumber - length);i++)
		UWriteString(' ');	
}	
Ejemplo n.º 7
0
void RI_Test_1(void)
{
	if(rotation_Count < 100000)
	{
		rotate_RI_CW(5);
		rotate_RI_Counter_CW(5);
		_delay_ms(500);
	}
	else
	{
		Command_Display(Clear_Screen);	
		Command_Display(Go_Home);
		ltoa(rotation_Count, aNumberAsString, 10);
		UWriteString(aNumberAsString);	
		Set_Cursor_Position(1,2);
		UWriteString(finished_String);
		while(1)
		{
			
		}		
	}		
}