Arduino code

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 2.7CP
icon
Related questions
Question

Write an Arduino code to control two LEDs using two push buttons, given the bellow setup:

  • LED 1 is connected to pin 5
  • LED 2 is connected to pin 4
  • Button 1 is connected to pin 8
  • Button 2 is connected to pin 9

If both push buttons are pressed, LED 1 is ON and LED 2 is OFF. If one of the push buttons is pressed LED 2 is ON and LED 1 is OFF.

hint: you may use the if..else if statement (note: you may use other approaches)

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Computer System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage