thilaire / rpi-TM1638

Raspberry Pi driver for chained TM1638 boards
GNU General Public License v3.0
20 stars 14 forks source link

Switch Status Determination #5

Open wangdino opened 4 years ago

wangdino commented 4 years ago

Hello,

First of all thanks a lot for the lib.

I'm having a bit difficulty understanding this line here.

I could be wrong but it looks like in case K==0 the boolean would only work for switch 1 (n=0) and switch 5 (n=4), correct?

When S1 is pressed sw = [1, 0, 0, 0] and when S5 is pressed sw = [16, 0, 0, 0], in all other cases sw[K] would always be 0 and the function would not return a key pressed status.

Note: this is related to https://github.com/thilaire/rpi-TM1638/pull/4 If it's not fixed it will report error at L171.