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.
Fork of Hexi_Click_Relay_Example by
main.cpp@1:489e49494755, 2016-08-25 (annotated)
- Committer:
- maclobski
- Date:
- Thu Aug 25 16:45:46 2016 +0000
- Revision:
- 1:489e49494755
- Parent:
- 0:b492a09a523e
changed to slot 2;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| GregC | 0:b492a09a523e | 1 | #include "mbed.h" |
| GregC | 0:b492a09a523e | 2 | |
| maclobski | 1:489e49494755 | 3 | DigitalOut relay1(PTA11); |
| maclobski | 1:489e49494755 | 4 | DigitalOut relay2(PTC3); |
| GregC | 0:b492a09a523e | 5 | |
| GregC | 0:b492a09a523e | 6 | // main() runs in its own thread in the OS |
| GregC | 0:b492a09a523e | 7 | // (note the calls to Thread::wait below for delays) |
| GregC | 0:b492a09a523e | 8 | int main() { |
| GregC | 0:b492a09a523e | 9 | while (true) { |
| GregC | 0:b492a09a523e | 10 | relay1 = 1; |
| GregC | 0:b492a09a523e | 11 | Thread::wait(500); |
| GregC | 0:b492a09a523e | 12 | relay1 = 0; |
| GregC | 0:b492a09a523e | 13 | Thread::wait(500); |
| GregC | 0:b492a09a523e | 14 | relay2 = 1; |
| GregC | 0:b492a09a523e | 15 | Thread::wait(500); |
| GregC | 0:b492a09a523e | 16 | relay2 = 0; |
| GregC | 0:b492a09a523e | 17 | Thread::wait(500); |
| GregC | 0:b492a09a523e | 18 | } |
| GregC | 0:b492a09a523e | 19 | } |
| GregC | 0:b492a09a523e | 20 |
