Rewrite Arduino sketch to be object oriented.