Updated and corrected minor but that caused firmware to hang if LCD not present and trying to initialise it and use it.

Updated documentation for SR 3 Wire.
This commit is contained in:
fmalpartida
2015-03-14 17:47:34 +01:00
parent 4d2be4cdfd
commit c7010d013f
2 changed files with 21 additions and 8 deletions
+18 -7
View File
@@ -51,7 +51,16 @@ I2CIO::I2CIO ( )
// PUBLIC METHODS
// ---------------------------------------------------------------------------
Wire.beginTransmission(DisplayI2CAddress);
error = Wire.endTransmission();
if (error==0){
return 1;
}
else //Some error occured
{
return 0;
}
}
//
// begin
int I2CIO::begin ( uint8_t i2cAddr )
@@ -61,13 +70,15 @@ int I2CIO::begin ( uint8_t i2cAddr )
Wire.begin ( );
_initialised = Wire.requestFrom ( _i2cAddr, (uint8_t)1 );
#if (ARDUINO < 100)
_shadow = Wire.receive ();
#else
_shadow = Wire.read (); // Remove the byte read don't need it.
#endif
if (_initialised)
{
#if (ARDUINO < 100)
_shadow = Wire.receive ();
#else
_shadow = Wire.read (); // Remove the byte read don't need it.
#endif
}
return ( _initialised );
}
+3 -1
View File
@@ -138,7 +138,9 @@ public:
@discussion Sets the pin in the device to control the backlight. This device
doesn't support dimming backlight capability.
@param 0: backlight off, 1..255: backlight on.
@param value: pin mapped on the 74HC595N (0, .., 7) for (Qa0, .., Qh7)
respectively.
@param pol: polarity POSITIVE|NEGATIVE.
*/
void setBacklightPin ( uint8_t value, t_backlighPol pol );