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

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -