I'm trying to find a solution to quickly test and thus switch a very long list of variables. I've named them as such:
mcp1pin1
mcp1pin2
mcp1pin3
...
mcp2pin1
mcp2pin2
mcp2pin3
...
As such, typing them all out manually would be quite difficult and long, and so I thought I could use the count() function to do this for me.
I've tried:
while True:
        count = 0
        while count < 16:
           mcp1pin(count).value = True
           time.sleep(0.1)
           mcp1pin(count).value = False
           count = count +1
But I could not make this work.... I feel like I might be close. Anyone has any suggestion for me? Thank you!
 
    