Mac Lobdell / Mbed OS Hexi_Click_Relay_Example

Fork of Hexi_Click_Relay_Example by Hexiwear

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut relay1(PTA11);
00004 DigitalOut relay2(PTC3);
00005 
00006 // main() runs in its own thread in the OS
00007 // (note the calls to Thread::wait below for delays)
00008 int main() {
00009     while (true) {
00010         relay1 = 1;
00011         Thread::wait(500);
00012         relay1 = 0;
00013         Thread::wait(500);
00014         relay2 = 1;
00015         Thread::wait(500);
00016         relay2 = 0;
00017         Thread::wait(500);
00018     }
00019 }
00020