element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum LED Button push light up
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 38 replies
  • Subscribers 389 subscribers
  • Views 25992 views
  • Users 0 members are here
  • sequence
  • led
  • button
Related

LED Button push light up

Josephmbrandtii
Josephmbrandtii over 3 years ago

Attempting to make a Cornhole score board with 21 lights that light up at each button push.  At the end of the chain i want it to shut off the lights so there is none.  I am very new to this and have only gotten to the research part.  Any help i can get will be amazing.  Thank you.

  • Sign in to reply
  • Cancel

Top Replies

  • beacon_dave
    beacon_dave over 3 years ago +7
    Is the button to be controlled by a person or is the button controlled automatically by the cornsack/beanbag passing through the hole in the board ? What sort of lights are you planning on using ? Individual…
  • javagoza
    javagoza over 3 years ago +5
    Maybe you can use addressable LEDs https://www.makerguides.com/how-to-control-ws2812b-individually-addressable-leds-using-arduino/
  • geralds
    geralds over 3 years ago in reply to Josephmbrandtii +5
    Hi, here a suggestion: As I saw you have drawn it from the example from the datasheet. Now this is the complete circuit including the bypass capacitors and one of a possible method to make the…
Parents
  • javagoza
    0 javagoza over 3 years ago

    Maybe you can use addressable LEDs

    https://www.makerguides.com/how-to-control-ws2812b-individually-addressable-leds-using-arduino/

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 3 years ago in reply to javagoza

    It will save a lot of DIY'ing too, since they already come in strips (e.g. mount behind clear plastic, and have printed card on front), and it would be a pain to wire up 21 LEDs to a board.

    This might be the quickest way.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 3 years ago in reply to shabaz

    Pixel strings may be alternative to pixel strips.

    12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) - WS2801:
    https://www.adafruit.com/product/322

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 3 years ago in reply to beacon_dave
    beacon_dave said:
    Pixel strings may be alternative

    Great find! Adafruit has excellent examples and tutorials to go along with them too - and it looks like it only needs 2 pins to make it work.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Josephmbrandtii
    0 Josephmbrandtii over 3 years ago in reply to ntewinkel

    Would it be able to be wired to light up one at a time?  And then after 21 shut off all lights. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 3 years ago in reply to Josephmbrandtii

    Yes. On the face of it, based on what you have stated, those addressable products (either a strip, which might be a bit cheaper, or the pixel strings which might look better, would meet your need, and would be perhaps the easiest and quickest way to achieve it. They are often known as 'neopixel' if you wish to search for it.

    They will work with pretty much any Arduino board, or even Pi Pico board, depends on your preference. If you google the board name that you choose, along with the text "neopixel" you'll find plenty of example code to control individual lights. The link that javagoza and beacon_dave have provided would be good examples to start with.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Josephmbrandtii
    0 Josephmbrandtii over 3 years ago in reply to shabaz

    Thank you for your help. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 3 years ago in reply to Josephmbrandtii

    If you look toward the end of that Makerguides article that javagoza linked to, it tells you how to change a single LED in the pixel LED strip.

    Look for: "How do you control individually addressable LEDs?"

    You can set the red, green, and blue values of each LED independently.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Josephmbrandtii
    0 Josephmbrandtii over 3 years ago in reply to beacon_dave

    This is super helpful 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 3 years ago in reply to Josephmbrandtii

    More documentation on the FastLED library here:

    https://github.com/FastLED/FastLED/wiki/Basic-usage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • javagoza
    0 javagoza over 3 years ago in reply to beacon_dave

    ralphjyrecently tested a very interesting product that consists of a matrix of 10x10 addressable rgb leds that come unconnected and that can be very useful for a project like this, being able to use one or more leds for each score unit depending on the intensity of light that you need. And since they have to be wired, you decide the distance between each LED.

    (+) NeoPixel Dice - Ralph Yamamoto's Blog - Personal Blogs - element14 Community

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 3 years ago in reply to javagoza

    Well remembered ! Adafruit do something similar using their Flora pixels if you want something a bit larger to work with.

    https://www.adafruit.com/product/1559

    It is not clear though if the design of the scoreboard is already finalised or not. If it is a retrofit to a typical vertical style scoreboard then the LED strip spacing will need to be close enough to that of the spacing of the numbers already printed. The strings may be easier to work with than the tapes.

    Some scoreboards have holes for pegs, so not sure if the intention is to try and stick a LED into an existing peg hole, so a round LED of suitable diameter may work better than a square pixel.

    Also not clear as to the number of scoreboards involved. If it's a one-off, then hand soldering the 42 LEDs isn't much of an issue. If it is 10+ then pre-wired strings/tapes may start looking like a good plan.  

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • beacon_dave
    0 beacon_dave over 3 years ago in reply to javagoza

    Well remembered ! Adafruit do something similar using their Flora pixels if you want something a bit larger to work with.

    https://www.adafruit.com/product/1559

    It is not clear though if the design of the scoreboard is already finalised or not. If it is a retrofit to a typical vertical style scoreboard then the LED strip spacing will need to be close enough to that of the spacing of the numbers already printed. The strings may be easier to work with than the tapes.

    Some scoreboards have holes for pegs, so not sure if the intention is to try and stick a LED into an existing peg hole, so a round LED of suitable diameter may work better than a square pixel.

    Also not clear as to the number of scoreboards involved. If it's a one-off, then hand soldering the 42 LEDs isn't much of an issue. If it is 10+ then pre-wired strings/tapes may start looking like a good plan.  

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Josephmbrandtii
    0 Josephmbrandtii over 3 years ago in reply to beacon_dave

    I am planning on drilling holes for the bulbs to go in. And the light next to the score to be lit. After 21 points I want it to have all lights go out on the next button push.  Once I have that figured out I need to do it for both sides. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 3 years ago in reply to Josephmbrandtii

    Perhaps create a variable to hold the button press count.

    Each button press increments the count variable by one.

    Then check the current value of the count variable.

    If it is less than 1 then turn off all the LEDs. 

    If it is between 1 and 21 then turn off all the LEDs and then turn on the LED that matches the current count value.  

    If it is greater than 21, then turn off all the LEDs and then reset the count back to 0.

    For the second side you just need a second counter that gets incremented by the second button.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube