element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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 Have a question about Arduino? Ask me!
  • 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
  • Replies 1914 replies
  • Subscribers 528 subscribers
  • Views 68410 views
  • Users 0 members are here
  • jeremy_blum
  • expert
  • student
  • arduino
Related

Have a question about Arduino? Ask me!

sciguy14
sciguy14 over 15 years ago

This thread has been closed to new questions.

However, we welcome you to Post Your Questionabout Arduino in the element14 Community Arduino group.  You'll find many fellow members and experts who have just the answer you're looking to find! 

 

Thank You, Your Friends at element14 Community


image

Jeremy Blum

Jeremy is an Electrical and Computer Engineering Student at Cornell University. He has been building microcontroller projects since high school, from a prototype prosthetic hand with a novel control scheme, to a nerf gun that fires at the intruders and uploads their picture to the web.
  • Sign in to reply
  • Cancel

Top Replies

  • billabott
    billabott over 13 years ago in reply to e14 Contributor +2
    @Brendan Your video is somewhat adequate for the intended purpose, however, from an engineer's point of view it is lacking in providing pertinent facts. Such as the part number, data sheet, and source…
  • e14 Contributor
    e14 Contributor over 15 years ago +1
    Jeremy, thanks for your intro videos. I am just getting started myself in Arduino though I have done some simple electronics projects using Atmel chips. Here is an example using ATTiny13 chips. www.youtube…
  • e14 Contributor
    e14 Contributor over 15 years ago +1
    Hi Jeremy I've built a device (see picture) with an Arduino and Ethernet shield that connects to our Network Monitor (Nagios) and moves an arrow to indicate if any of the computers we monitor are not responding…
Parents
  • e14 Contributor
    e14 Contributor over 13 years ago

    Hey Jeremy i had a question i asked on another forum but they couldnt seem to answer it. I dont know if they couldnt comprehend what i was asking or if they just dont know i made a video trying to explain it being that i am completly new to the arduino and had no idea what they were talking about.

     

    heres the video

    http://www.youtube.com/watch?v=2IrCplYeUZw

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • e14 Contributor
    e14 Contributor over 13 years ago

    Hey Jeremy i had a question i asked on another forum but they couldnt seem to answer it. I dont know if they couldnt comprehend what i was asking or if they just dont know i made a video trying to explain it being that i am completly new to the arduino and had no idea what they were talking about.

     

    heres the video

    http://www.youtube.com/watch?v=2IrCplYeUZw

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • shabaz
    shabaz over 13 years ago in reply to e14 Contributor

    Hi Brendan,

     

    To summarize your video, it looks like you've got a rotary switch (something like a 4-pole 5-way switch), and you want to have a delay in your software

    that corresponds to the switch position.

     

    You can use standard digital inputs, no need to use the analog inputs on your board (or configure the analog inputs to be digital inputs). On the rotary switch, normally the inner ring of contacts are the 'poles', and you can connect one of them to 0V. Then, connect the outer contacts to digital inputs on your board.

    (To confirm that you're using the correct pins before you plug it into the board, you could use a multimeter set to continuity check mode).

    Then, in your code, ensure that the digital inputs have 'pull-up' resistors enabled (see here for information on how to do this).

     

    When the rotary switch is in an appropriate position, then the pin will be forced to 0V, and this is something you can detect in your software.

     

    Search for a code example that detects an input condition, e.g. using digitalRead I think.

    Then, your code can have something like (my syntax may be incorrect):

    if (digitalRead(position0pin)==LOW) delay=2000;

    if (digitalRead(position1pin)==LOW) delay=4000;

    and so on.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • billabott
    billabott over 13 years ago in reply to e14 Contributor

    @Brendan

     

    Your video is somewhat adequate for the intended purpose, however, from an engineer's point of view  it is lacking in providing pertinent facts.  Such as the part number, data sheet, and source of the device in question which is apparently a multi-pole switch.   Therefore, anything I opine about is subject to change because I don't really know what device you are wanting to use.  That said, let us spread the Vegemite on the corn dodgers!

     

    I am wondering if a single analog input might be the best way to do your project.  If you have a packet of equal valued resistors, then it might work out if you were to link the outer solder tabs with the resistors all in series with one end being ground and the far end +5 volts.  Thus creating a voltage divider that can be read from the common center tab(s) with the analog input pin.  As far a programming it in the Arduino sketch, it simply calls for the correct application of the Switch/Case statement syntax.

     

    N.B.  I seem to recall that the analog inputs have trouble at one extreme value or the other of the range.   Therefore,  I recommend looking it up for yourself.  The solution, of course, is adding one more resistor in series with the others.

     

    If I were to do this project, I would set up the voltage divider so that I could use the modulo function, %, to read off the switch position almost directly.  For example:  Switch Position 1 = 105/1023, SP 2 = 205/1023, ... , SP 10 = 1005/1023  then the Var in Switch (Var) is computed directly by Var = int(( A0 - ( A0 % 100 )) / 100 )  which then allows the Case #:  to be indexed and controlled by the integer values of Var = SP which is 1 thru 10.

    [ Yes, of course, you could use the map() function.  It is your project after all. ]

     

    If your resistors are not of a consistant quality the +/- 10% may cause a little trouble.  If so, just add a little fudge factor to A0 of approximately 6% and it should work itself out.  ie  A0 = A0 * 1.06   before calculating the Var.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 13 years ago in reply to billabott

    @Brendan, I like Billabott's idea of maybe using a single analog input instead, like the 10k potentiometer in this example: http://www.oomlout.com/oom.php/products/ardx/circ-08

     

    I think it will be much easier than trying to deal with all those pins and possibilities.

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube