c++ - Register first button pressed. -
i'm making simple quiz app on raspberry under raspbian using c++. want store pressed button first. 4 momentary buttons connected pi via gpio, testing using keyboard.
how should function reading buttons avoid simultaneous presses?
thanks
if record timestamp nanosecond resolution of when "press" happened unlikely duplicates. , in unlikely event do, pick random 1 of dupes since that's right whatever else ;) see http://en.cppreference.com/w/cpp/chrono
Comments
Post a Comment