Connect with us

Selector Button

Discussion in 'General Electronics Discussion' started by Shaun101, Oct 24, 2015.

Scroll to continue with content
  1. Shaun101


    Oct 24, 2015
    Hi all,

    I am new to this, so it may be an obvious answer.

    I am building a circuit utilising microcontrollers and switches as well as 7 segment displays. What I want to be able to do is use a button/switch to select one of 3 options. Press once for option 1, press twice for option 2 etc. Also I want the different option numbers to be shown on the segment displays.

    Can anyone point me in the right direction? I will be using Picaxe-18M2 for the programming if that helps.

  2. ramussons


    Jun 10, 2014
    Since you want to count upto 3 (for the 3 options), you need to have a 2 bit binary counter whose output ( 00, 01, 10, 11) can be decoded to the chosen option. A CMOS chip 4511 should help you thru'.

    Just ground the Inputs C and D.
  3. BobK


    Jan 5, 2010
    This can be done completely in software, no need to add an external counter.

    You need to do the following:

    1. Learn how to de-bounce a switch in software.
    2. Make your program check for a new push of the switch periodically, with the period being 1/10th of a second or so.
    3. Keep a variable that tells what mode you are in and cycle it to the next mode with each button press you detect.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day