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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -