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 problem with digital input pins in controlling its output pins.. we really need suggestions...
  • 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 Suggested Answer
  • Replies 7 replies
  • Answers 1 answer
  • Subscribers 418 subscribers
  • Views 733 views
  • Users 0 members are here
Related

problem with digital input pins in controlling its output pins.. we really need suggestions...

e14 Contributor
e14 Contributor over 13 years ago

i have 2 digital input pins(pin16 & pin17 actually i need 4)

just to test if it really gonna work.What i did is that

i just give 5volts or high to these pins as input data

but what happened there is that the 2 digitalOutput pins respectively

seems doesnt do to the conditions i gave it seems it can affect the other condition.

 

 

here is a part of my code .

 

  if (digitalRead(16) == LOW )

    { digitalWrite(ledPin7,HIGH);

    }

  if (digitalRead(17) == LOW )

    { digitalWrite(ledPin6,HIGH);

    }

 

  else

    digitalWrite(ledPin7,LOW);

    digitalWrite(ledPin6,LOW);

 

          ,,

          what i really want to do there is that

          just have  4  inputs(that would be 5volts)

          and also give 4  outputs respectively..

 

we really need Ur suggestions  and ideas.. thnx ;d

  • Sign in to reply
  • Cancel

Top Replies

  • mcb1
    mcb1 over 13 years ago in reply to billabott +2
    Nico Well done One other way is to make them LOW and change them if the button is LOW. digitalWrite(ledPin7,LOW); digitalWrite(ledPin6,LOW); if (digitalRead(16) == LOW ) { digitalWrite(ledPin7,HIGH); …
  • ntewinkel
    ntewinkel over 13 years ago +1 suggested
    I think it might be the way you are building your if...else statements. Try this way: if (digitalRead(16) == LOW ) { digitalWrite(ledPin7,HIGH); } else { digitalWrite(ledPin7,LOW); } if (digitalRead(17…
  • billabott
    billabott over 13 years ago in reply to ntewinkel +1
    Arduino IDE is modified version of the Processing Application as specified on Processing.org. (Think Turtle programming) My question is a carry over tangent from the J.Blum Arduino discussion.
Parents
  • billabott
    0 billabott over 13 years ago

    I like this.  It is really much better to start a new discussion and it would be a good idea to now delete that old original duplicate post.

     

    I did make a suggestion.  Did you not see it?  It has been removed now.

     

    Here it is again.

     

    Seems to me that what you require is an 8 bit (4 inputs plus 4 outputs) I2C i/o expander chip.

     

    They are frequently used to take the 8 minumum required inputs of a standard 2x16 LCD and convert it to Serial LCD.  The I2C LCD can be seen on eBay and wherever other fine electronics parts are sold.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • billabott
    0 billabott over 13 years ago

    I like this.  It is really much better to start a new discussion and it would be a good idea to now delete that old original duplicate post.

     

    I did make a suggestion.  Did you not see it?  It has been removed now.

     

    Here it is again.

     

    Seems to me that what you require is an 8 bit (4 inputs plus 4 outputs) I2C i/o expander chip.

     

    They are frequently used to take the 8 minumum required inputs of a standard 2x16 LCD and convert it to Serial LCD.  The I2C LCD can be seen on eBay and wherever other fine electronics parts are sold.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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