Use the timeout class to provide a two second delay during


Create a new mBed C-Code project called IntCount1 that repeatedly counts the number of falling edge interrupts on mBed module Pin 5 (p5) during a two second interval. Use the Timeout class to provide a two second delay. During the delay, display the number of interrupts that are occurring on Pin 5 using LED1-LED4. LED1 is the low-order bit. Use only the BusOut class for driving the LEDs. Using the Timeout "attach" function, create a subroutine that Timeout will call at the end of the two second interval. At the end of the two second interval, the subroutine will use the USB serial port to output the number of interrupts seen by displaying, "Total Ints = xx", where xx is the quantity of interrupts occurring in the two second interval. Assuming the interrupts were caused by a rotating shaft equipped with a sensor, the subroutine will compute the number of Revolutions per Minute (RPMs) represented by the total interrupts seen during the two second interval. Display the RPM value on the next line with RPMs = yyy", where yyy is the computed RPM value. The LEDs should be cleared before the

next interval starts. Using "wait", provide a one second delay prior to clearing the LEDs and starting the next two second interval. The program should run "forever".

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: Use the timeout class to provide a two second delay during
Reference No:- TGS0615911

Expected delivery within 24 Hours