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)
I think the error you're seeing is from not taking the fourth part of the variable pins.
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!
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 ?
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.
I've followed this to the letter and all that happened is the first led in the series turned on then off and the other seven did nothing. Any advice?
Are you certain that the other 7 LEDs are properly connected?
Also, if you are sure of that, does using
etc. for all the other pins work to turn the LEDs on manually?