![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
relay exmaples
Fork of Hexi_Click_Relay_Example by
Diff: main.cpp
- Revision:
- 0:b492a09a523e
- Child:
- 1:489e49494755
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Aug 24 22:27:49 2016 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +DigitalOut relay1(PTA10); +DigitalOut relay2(PTC4); + +// main() runs in its own thread in the OS +// (note the calls to Thread::wait below for delays) +int main() { + while (true) { + relay1 = 1; + Thread::wait(500); + relay1 = 0; + Thread::wait(500); + relay2 = 1; + Thread::wait(500); + relay2 = 0; + Thread::wait(500); + } +} +