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.
Dependencies: mbed A3_1_Single_Timer
Diff: main.cpp
- Revision:
- 3:d90d04dce9f2
- Parent:
- 2:de9d94dc0454
--- a/main.cpp Tue Oct 06 14:53:06 2020 +0000
+++ b/main.cpp Tue Oct 06 15:04:26 2020 +0000
@@ -1,18 +1,24 @@
-
#include "mbed.h"
Ticker tickerLED2; //creat ticker object
+Ticker tickerLED3;
DigitalOut LEDOut2(LED2);
+DigitalOut LEDOut3(LED3);
void changeLED2() //the function that will be called by the ticker object.
{
LEDOut2 = !LEDOut2;
}
+void changeLED3() //function called for other ticker object LED3
+{
+ LEDOut3 = !LEDOut3;
+}
int main()
{
tickerLED2.attach(&changeLED2,0.2); //the address of the function to call
//and the interval in seconds between
//calls to that function
+ tickerLED3.attach(&changeLED3,0.8); //changing the interval in seconds for LED3
while(1) {
wait(0.1);