What is the right way to match the second position in my array?
my array (d) from HID is [1,1,0,0,0,0,0] or [1,0,0,0,0,0,0]
when position 2 is 1, I want to meet my condition.
This is what I have hacked together:
while True:
d = h.read(64)
if d:
for btn, val in enumerate(d):
if btn == 1:
if val == 1:
print("Condition Finally Met")