Question: Modify the function loop() that prints the state of on_off, so that on_off is initially and switches from 0 to 1 and back from 1

 Modify the function loop() that prints the state of on_off, so

Modify the function loop() that prints the state of on_off, so that on_off is initially and switches from 0 to 1 and back from 1 to 0 every time the digitalRead(13) steps up from 0 to 1. Hint: use prev_read to keep track of the previous reading of pin 13. 7777 DON'T CHANGE THIS typedef std::vector ivec; void loop: void println(int x) (printf("%d ",x);) ivec reads; int ron=8: int digitalRead(int pin) {return reads Cron++]:) void toggle_onoff (Ivec vt reads=v; for (int i=0;i1>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!