Created
October 31, 2014 18:56
-
-
Save Arachnid/9b4820d7b857cb3d6d1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
class Monitored { | |
protected: | |
T value; | |
boolean dirty; | |
public: | |
Monitored<T>& operator=(const T source) { | |
value = source; | |
dirty = true; | |
} | |
operator T() { | |
return value; | |
} | |
void write(Serial out); | |
}; | |
void Monitored<int>::write(Serial out) { | |
out.print(value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment