There is an updated version of this post available here.
I have trying toggle LED through GPIO. Toggling single LED works. But i tried, the Do loop getting the - A pin number of list of pin numbers is expected.
Please refer the attached screen shot for details. Any suggestion welcome. (hope it will be useful for others as well)
With regards, Chandra
Hi Chandra, I think the error you're seeing is from not taking the fourth part of the variable pins. For example, I think what you need is
The first one will take the fourth member of the pins list, while the second one will try and call a function named pins with an argument of 4. Hope this helps, and let us know how it goes! Thanks, Ian
I have tried with pins[] as well. I am using the second script on shown in the screen shot. It gives the same error Not sure..why? Further, I have connected single LED on GPIO pin 4. Appreciate you help. Any documentaion ? Many thanks Chandra
Okay, so when you use the Do loop, you only need to have
You can check the documentation for Do at
Here, you are using form 2 as mentioned in the documentatuon, and you need form 1, as you're not iterating over anything, you just want to run it a certain number of times.