Skip to content

Instantly share code, notes, and snippets.

@Arachnid
Created October 31, 2014 18:56
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 Arachnid/9b4820d7b857cb3d6d1e to your computer and use it in GitHub Desktop.
Save Arachnid/9b4820d7b857cb3d6d1e to your computer and use it in GitHub Desktop.
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