Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract calls to digitalWrite and pinMode from the outside "world" by making virtual protected methods #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/LiquidCrystal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,10 @@ void LiquidCrystal::write8bits(uint8_t value) {

pulseEnable();
}

void LiquidCrystal::digitalWrite(int pin, int value) {
::digitalWrite(pin, value);
}
void LiquidCrystal::pinMode(int pin, int mode) {
::pinMode(pin, mode);
}
3 changes: 3 additions & 0 deletions src/LiquidCrystal.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class LiquidCrystal : public Print {
void command(uint8_t);

using Print::write;
protected:
virtual void digitalWrite(int pin, int value);
virtual void pinMode(int pin, int mode);
private:
void send(uint8_t, uint8_t);
void write4bits(uint8_t);
Expand Down