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.
Revision 1:d36e7cd21756, committed 2021-05-07
- Comitter:
- mjuric
- Date:
- Fri May 07 16:03:58 2021 +0000
- Parent:
- 0:547750d3b48b
- Commit message:
- Morse
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri May 07 11:53:35 2021 +0000
+++ b/main.cpp Fri May 07 16:03:58 2021 +0000
@@ -1,12 +1,10 @@
#include "mbed.h"
#include "MorseWrite.h"
-
// inicijalizacija klase za ispis Morse koda
// digitalni pin 2 - led za ispis
// digitalni pin 4 - tipkalo prekid ispisa
MorseWrite LED(D2);
-// tipkalo je spojeno na digitalni pin 4
-InterruptIn button(D4);
+InterruptIn button(D4); // tipkalo je spojeno na digitalni pin 4
Timer debounce;
void writeSOS();
@@ -18,12 +16,10 @@
while(true){}
}
-
void writeSOS(){
- // Predajemo poruku koju želimo poslati (u ovom slučaju
- // prikazujemo poruku "SOS" pomoću led diode) te duljinu poruke
- // (broj znakova)
- if (debounce.read_ms()>200)
- LED.write(0b110000001001010110000000, 12);
+
+ if (debounce.read_ms()>200) // Predajemo poruku koju želimo poslati
+ //(u ovom slučaju prikazujemo poruku "SOS" pomoću led diode) te duljinu poruke
+ LED.write(0b110000001001010110000000, 12); // (broj znakova)
debounce.reset();
}
\ No newline at end of file