int Cyclometer::initCyclometer(){ display = Display(); //TODO init and run calculations = Calculations(); //TODO init and run buttonCntrl = ButtonController(); //TODO init and run //TODO Pass each class required values for updates? while (1) { //give Diplay required values //give Calculations required values //broadcast next event } }
} uint8_t ButtonController::upPressed(void) { if (digitalRead(upPin) == LOW) { return 1; } else { return 0; } } uint8_t ButtonController::downPressed(void) { if (digitalRead(downPin) == LOW) { return 1; } else { return 0; } } uint8_t ButtonController::firePressed(void) { if (digitalRead(firePin) == LOW) { return 1; } else { return 0; } } // Preinstantiate default ButtonController object for the integrated controller ButtonController Controller = ButtonController();