Exemple #1
0
int lcd_init(){
  wiringPiSetupSys () ;
  mcp23017Setup (AF_BASE, 0x20) ;

  adafruitLCDSetup (105) ; //setze Farbe

  lcdPosition (lcdHandle, 0, 0) ; lcdPuts (lcdHandle, "Warmwasserproben") ;
  lcdPosition (lcdHandle, 0, 1) ; lcdPuts (lcdHandle, " Daten Aufnahme ");
  sleep (2);
  lcdPosition (lcdHandle, 0, 0) ; lcdPuts (lcdHandle, "Start --->      ") ;
  lcdPosition (lcdHandle, 0, 1) ; lcdPuts (lcdHandle, "Press Select... ");
  waitForEnter () ;
  lcdClear (lcdHandle) ;
  adafruitLCDSetup (103) ; //setze Farbe
  
  return(0);
}
Exemple #2
0
bool CHD44780::open()
{
	::wiringPiSetup();

	if (m_pwm) {
		if (m_pwmPin != 1U) {
			::softPwmCreate(m_pwmPin, 0, 100);
			::softPwmWrite(m_pwmPin, m_pwmDim);
		} else {
			::pinMode(m_pwmPin, PWM_OUTPUT);
			::pwmWrite(m_pwmPin, (m_pwmDim / 100) * 1024);
		}
	}

#ifdef ADAFRUIT_DISPLAY
  adafruitLCDSetup();
#endif

	m_fd = ::lcdInit(m_rows, m_cols, 4, m_rb, m_strb, m_d0, m_d1, m_d2, m_d3, 0, 0, 0, 0);
	if (m_fd == -1) {
		LogError("Unable to open the HD44780");
		return false;
	}

	::lcdDisplay(m_fd, 1);
	::lcdCursor(m_fd, 0);
	::lcdCursorBlink(m_fd, 0);
	::lcdCharDef(m_fd, 0, fmChar);
	::lcdCharDef(m_fd, 1, toChar);
	::lcdCharDef(m_fd, 2, mChar);
	::lcdCharDef(m_fd, 3, dChar);
	::lcdCharDef(m_fd, 4, vChar);

	/* 
		TG, private call, RF and network icons defined as needed - ran out of CGRAM locations
		on the HD44780!  Theoretically, we now have infinite custom characters to play with,
		just be mindful of the slow speed of CGRAM hence the lcdPosition call to delay just 
		long enough so the CGRAM can be written before we try to read it.
	*/

	return true;
}
Exemple #3
0
bool CHD44780::open()
{
	::wiringPiSetup();

#ifdef ADAFRUIT_DISPLAY
	adafruitLCDSetup();
#endif

    m_fd = ::lcdInit(m_rows, m_cols, 4, m_rb, m_strb, m_d0, m_d1, m_d2, m_d3, 0, 0, 0, 0);
	if (m_fd == -1) {
		LogError("Unable to open the HD44780");
		return false;
	}

	::lcdDisplay(m_fd, 1);
	::lcdCursor(m_fd, 0);
	::lcdCursorBlink(m_fd, 0);

	return true;
}