コード例 #1
0
/** 
 * @brief This function is still not working correctly. Technically the
 * function should set the cursor to a well defined position in the LCD, but
 * it is not doing so for the second line. I think my LCD is broken. Until, I 
 * fix this function (or at least test it with different LCDs) do not use it.
 * @param line Line number; where 0 is the top line and 1 is the bottom line.
 * @param position Position; where the initial position is 0.
 * @param enabled_gpio[] Initialized array of gpioID. 
 **/
void goto_ScreenLocation(int line, int position,struct gpioID enabled_gpio[])
{
	unsigned int data_to_write;

	if (line==1) position=position+64;
	data_to_write=return_address_in_bitform(position,0);
	data_to_write=bitWrite(data_to_write,1,0);

    digitalWrite_multiple(enabled_gpio,6,data_to_write);  
	pulsePin(enabled_gpio,data_to_write,6,5,0);

	data_to_write=return_address_in_bitform(position,1); 
    digitalWrite_multiple(enabled_gpio,6,data_to_write);  
	pulsePin(enabled_gpio,data_to_write,6,5,0);
}
コード例 #2
0
ファイル: beagle_hd44780.c プロジェクト: bonnaffe/fluidfire
/** 
 * @brief This function is still not working correctly. Technically the
 * function should set the cursor to a well defined position in the LCD, but
 * it is not doing so for the second line. I think my LCD is broken. Until, I 
 * fix this function (or at least test it with different LCDs) do not use it.
 * @param line Line number; where 0 is the top line and 1 is the bottom line.
 * @param position Position; where the initial position is 0.
 * @param selected_GPIOs[] Initialized array of gpioID. 
 **/
void goto_ScreenLocation(int line, int position,struct gpioID enabled_gpio[])
{
	int nbr_selectedPins=6;
	unsigned int data_to_write;

	//printf("position: %d\n",position);
	//printf("line: %d\n\n",line);
	
	if (line==1) position=position+40;
	data_to_write=return_address_in_bitform(position,0);
	//printf("data_to_write: %d\n",data_to_write);
	data_to_write=bitWrite(data_to_write,1,0);
	//printf("<%d>\n",data_to_write);
	turn_ON_OFF_pins(enabled_gpio,data_to_write,nbr_selectedPins);
	pulsePin(enabled_gpio,data_to_write,nbr_selectedPins, 5, CMD_DELAY);
  	usleep(CMD_DELAY);

	data_to_write=return_address_in_bitform(position,1); 
	//printf("data_to_write: %d\n",data_to_write);
	turn_ON_OFF_pins(enabled_gpio,data_to_write,nbr_selectedPins);
	pulsePin(enabled_gpio,data_to_write,nbr_selectedPins, 5, CMD_DELAY);
  	usleep(CMD_DELAY);
}
コード例 #3
0
/** 
 * @brief This function is still not working correctly. Technically the
 * function should set the cursor to a well defined position in the LCD, but
 * it is not doing so for the second line. I think my LCD is broken. Until, I 
 * fix this function (or at least test it with different LCDs) do not use it.
 * @param line Line number; where 0 is the top line and 1 is the bottom line.
 * @param position Position; where the initial position is 0.
 * @param selected_GPIOs[] Initialized array of gpioID. 
 **/
void goto_ScreenLocation(int line, int position,struct gpioID enabled_gpio[])
{
	int nbr_selectedPins=6;
	const char *pinDescription[] = {"","","","","",""};
	unsigned int data_to_write;

	//printf("position: %d\n",position);
	//printf("line: %d\n\n",line);
	
	if (line==1) position=position+40;
	data_to_write=return_address_in_bitform(position,0);
	//printf("data_to_write: %d\n",data_to_write);
	data_to_write=bitWrite(data_to_write,1,0);
	//printf("<%d>\n",data_to_write);
	turn_ON_OFF_pins(enabled_gpio,data_to_write,nbr_selectedPins,MAX_DELAY,pinDescription);
	pulsePin(enabled_gpio,data_to_write,nbr_selectedPins,DISPLAY_DATA_ON_SCREEN, pinDescription, 5, MAX_DELAY);
  	sleep(MAX_DELAY);

	data_to_write=return_address_in_bitform(position,1); 
	//printf("data_to_write: %d\n",data_to_write);
	turn_ON_OFF_pins(enabled_gpio,data_to_write,nbr_selectedPins,MAX_DELAY,pinDescription);
	pulsePin(enabled_gpio,data_to_write,nbr_selectedPins,DISPLAY_DATA_ON_SCREEN, pinDescription, 5, MAX_DELAY);
  	sleep(MAX_DELAY);
}