Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- jmclaughlin
- Date:
- 2021-10-15
- Revision:
- 2:427bf460dd91
- Parent:
- 1:3cadb8807520
File content as of revision 2:427bf460dd91:
/* Author: Jessica McLaughlin, revised from Stephen Licht Last Modified: 10/14/2021 Assignment: Multiple Timers, A2 Pt. 2 */ #include "mbed.h" Timer timerLED2; //create timer object Timer timerLED3; DigitalOut LEDOut2(LED2); DigitalOut LEDOut3(LED3); int main() { timerLED2.start(); //start timer counting timerLED3.start(); while(1) { if (timerLED2.read_ms()>=200) { //check to see if time has been exceeded LEDOut2 = !LEDOut2; timerLED2.reset(); //reset the timer back to zero } if (timerLED3.read_ms()>=400) { //if exceeds on for 400ms LEDOut3 = !LEDOut3; timerLED3.reset(); } } //while }