4. Write a code that S1(push button -P1.1) turns LED1 (Red LED- P1.0) ON and stays...

80.2K

Verified Solution

Question

Electrical Engineering

4. Write a code that S1(push button -P1.1) turns LED1 (RedLED- P1.0) ON and stays on when you push once and turns off andstays OFF when you push 3times. This should repeat forever.

5. Write a code that S2(pushbutton -P1.2) turns LED2 (Red LED- P9.7) ON and stays ON when youpush once and turns OFF and stays OFF when you push 3 times. Thisshould repeat five times.

6. Write a code that LED2(Red LED- P9.7) ON when as long as you push S2(push button - P1.2)and LED1 (Red LED- P1.0) on as long as S2(push button -P1.2) notpushed.

Answer & Explanation Solved by verified expert
3.7 Ratings (515 Votes)
include enum LED1 ON OFF led enum variable for LED ONOFF int pushcount counter to count push number int flag a flag    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students