1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Update LiquidCrystal.* copy to work with 1.0

Print::write() has a new signature in Arduino 1.0.
This commit is contained in:
Rhys Weatherley 2012-06-10 10:16:59 +10:00
parent 311f8bbc1a
commit a51aece7a8
2 changed files with 18 additions and 1 deletions

View File

@ -177,7 +177,7 @@ void LiquidCrystal::home()
void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
{
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
if ( row > _numlines ) {
if ( row >= _numlines ) {
row = _numlines-1; // we count rows starting w/0
}
@ -262,10 +262,21 @@ inline void LiquidCrystal::command(uint8_t value) {
send(value, LOW);
}
#if defined(ARDUINO) && ARDUINO >= 100
inline size_t LiquidCrystal::write(uint8_t value) {
send(value, HIGH);
return 1; // assume sucess
}
#else
inline void LiquidCrystal::write(uint8_t value) {
send(value, HIGH);
}
#endif
/************ low level data pushing commands **********/
// write either command or data, with automatic 4/8-bit selection

View File

@ -79,8 +79,14 @@ public:
void createChar(uint8_t, uint8_t[]);
void setCursor(uint8_t, uint8_t);
#if defined(ARDUINO) && ARDUINO >= 100
virtual size_t write(uint8_t);
#else
virtual void write(uint8_t);
#endif
void command(uint8_t);
using Print::write;
private:
void send(uint8_t, uint8_t);
void write4bits(uint8_t);