relay exmaples

Fork of Hexi_Click_Relay_Example by Hexiwear

main.cpp

Committer:
GregC
Date:
2016-08-24
Revision:
0:b492a09a523e
Child:
1:489e49494755

File content as of revision 0:b492a09a523e:

#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);
    }
}