Python Forum
functional LEDs in an array or list? // RPi user
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
functional LEDs in an array or list? // RPi user
#3
(Aug-21-2022, 03:18 PM)Yoriz Wrote: leds is a list, to access an item in the list use square brackets and give an index leds[0]
to use it in your code give the index as i provided by the for loop, line 25 = leds[i].on() and line 28 = leds[i].off()
Thank you! I don't know how i could miss something like that. I both love and dislike the "it was so obvious how couldn't i see it" feeling.
Back to work!
Reply


Messages In This Thread
RE: functional LEDs in an array or list? // RPi user - by Doczu - Aug-21-2022, 03:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  user input values into list of lists tauros73 3 1,107 Dec-29-2022, 05:54 PM
Last Post: deanhystad
Question How to let the user add 'None' to an specific array in a dictionary? noahverner1995 4 1,834 Dec-26-2021, 10:03 AM
Last Post: noahverner1995
  Stuck in functional proggaming haze hammer 2 1,432 Oct-27-2021, 02:07 PM
Last Post: hammer
  Make these LEDs stay on duckredbeard 5 3,026 Apr-08-2021, 10:26 PM
Last Post: duckredbeard
  Looking for a way to loop until user enters from a list? PythonW19 7 3,440 Mar-21-2021, 08:56 PM
Last Post: PythonW19
  OOP vs functional - - elaborate turn based RPG game (Derek Banas Udemy course again) Drone4four 6 4,005 Mar-14-2021, 08:38 AM
Last Post: ndc85430
  Calculating surface area - - OOP or functional? Derek Banas Udemy course Drone4four 5 3,679 Mar-13-2021, 06:22 AM
Last Post: buran
  User input/picking from a list AnunnakiKungFu 2 2,367 Feb-27-2021, 12:10 AM
Last Post: BashBedlam
  LIST or ARRAY Comparison and change of value nio74maz 0 1,720 Dec-21-2020, 05:52 PM
Last Post: nio74maz
Question Reset list if user regrets Gilush 1 2,102 Dec-05-2020, 10:55 AM
Last Post: Gilush

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020