Skip to content

Instantly share code, notes, and snippets.

@aster94
Last active March 9, 2019 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aster94/6bb1d1808686c1e7e7674f6ddded49e3 to your computer and use it in GitHub Desktop.
Save aster94/6bb1d1808686c1e7e7674f6ddded49e3 to your computer and use it in GitHub Desktop.
UniversalSerial
class CustomSerial {
private:
Stream &stream;
public:
CustomSerial(Stream &_stream) : stream(_stream) {}
int read() {
return stream.read();
}
int available() {
return stream.available();
}
void write(byte b) {
stream.write(b);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment