21isenough / LightningATM

This ATM sends bitcoin over the Lightning Network - pretty fun.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add smarter way of detecting and counting the inserted coins

21isenough opened this issue · comments

Actual Behavior:
Each of 6 different coins sends a certain amount of pulses to the RaspberryPi, that are then registered on a GPIO pin.

A variable is set to the amount of pulses and regularly read to determine the inserted coin. This leads to slight delays and coins can't be inserted too fast after one another.

Expected Behavior:
I imagine, it would be better to continuously populate an array with pulses (a representation thereof) and evaluate this array in a thread. This should allow for faster "coin insertions" and make the user experience smoother.

commented

good idea. I would say this also depends on the coin slot hardware so one would have to test the pulse time. but the pulses could be saved in a list with a time stamp and then later be read. dont think a thread is necessary but that might depend on what you use. i use kivy and it comes with a clock that allows for call back functions. Ill take a look.