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:
parent
311f8bbc1a
commit
a51aece7a8
@ -177,7 +177,7 @@ void LiquidCrystal::home()
|
|||||||
void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
|
void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
|
||||||
{
|
{
|
||||||
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
|
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
|
||||||
if ( row > _numlines ) {
|
if ( row >= _numlines ) {
|
||||||
row = _numlines-1; // we count rows starting w/0
|
row = _numlines-1; // we count rows starting w/0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,10 +262,21 @@ inline void LiquidCrystal::command(uint8_t value) {
|
|||||||
send(value, LOW);
|
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) {
|
inline void LiquidCrystal::write(uint8_t value) {
|
||||||
send(value, HIGH);
|
send(value, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/************ low level data pushing commands **********/
|
/************ low level data pushing commands **********/
|
||||||
|
|
||||||
// write either command or data, with automatic 4/8-bit selection
|
// write either command or data, with automatic 4/8-bit selection
|
||||||
|
@ -79,8 +79,14 @@ public:
|
|||||||
|
|
||||||
void createChar(uint8_t, uint8_t[]);
|
void createChar(uint8_t, uint8_t[]);
|
||||||
void setCursor(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);
|
virtual void write(uint8_t);
|
||||||
|
#endif
|
||||||
void command(uint8_t);
|
void command(uint8_t);
|
||||||
|
|
||||||
|
using Print::write;
|
||||||
private:
|
private:
|
||||||
void send(uint8_t, uint8_t);
|
void send(uint8_t, uint8_t);
|
||||||
void write4bits(uint8_t);
|
void write4bits(uint8_t);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user