コード例 #1
0
ファイル: I2CSensors.c プロジェクト: byrnedawg/Polska
void Set_Cursor_Position(uint8_t column, uint8_t row)
{	
	UWriteData(CMD);
	UWriteData(71);
	UWriteData(column);
	UWriteData(row);
}
コード例 #2
0
ファイル: cmd.c プロジェクト: 12019/gsmFBusControl
//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;
}
コード例 #3
0
void UWriteString(char *str)
{
	while((*str)!='\0')
	{
		UWriteData(*str);
		str++;
	}

	UWriteData('\0');
}
コード例 #4
0
ファイル: main.c プロジェクト: sujyao/2016_Finial_project
int main()
{
	//Initialize the USART with Baud rate = 2400bps
	USARTInit(416);

	//Enable Internal Pullups on PORTC
	PORTC=0xFF;
	/* 
	Keep transmitting the Value of Local PORTC
	to the Remote Station.

	On Remote RX station the Value of PORTC
	sent over AIR will be latched on its local PORTC
	*/
	
	uint8_t data;
	while(1)
	{
		data=PINC;

		/* 
		Now send a Packet
		Packet Format is AA<data><data inverse>Z
		total Packet size if 5 bytes.
		*/

		//Stabilize the Tx Module By Sending JUNK data
		UWriteData('J');	//J for junk

		//Send 'A'
		UWriteData('A');

		//Send Another 'A'
		UWriteData('A');

		//Send the data;
		UWriteData(data);

		//Send inverse of data for error detection purpose
		UWriteData(~data);

		//End the packet by writing 'Z'
		UWriteData('Z');

		//Wait for some time
		_delay_loop_2(0);
		_delay_loop_2(0);
		_delay_loop_2(0);
		_delay_loop_2(0);
		
		//indicate Button works 
	}
}
コード例 #5
0
ファイル: I2CSensors.c プロジェクト: byrnedawg/Polska
void Change_Baudrate(uint8_t speed)
{	
	UWriteData(CMD);
	UWriteData(Bauderate);
	UWriteData(speed);
}
コード例 #6
0
ファイル: I2CSensors.c プロジェクト: byrnedawg/Polska
void Command_Display(uint8_t command)
{
	UWriteData(CMD);
	UWriteData(command);
}