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.
main.cpp
00001 #include "mbed.h" 00002 /* 00003 This demo uses the Arduino Relay Sheild from Seeed. 00004 Here is the link to the shield 00005 http://wiki.seeed.cc/Relay_Shield_v3/ 00006 The Arduino pin mapping is as follows 00007 Ardino Relay 00008 D7 relay 1 00009 D6 relay 2 00010 D5 relay 3 00011 D4 relay 4 00012 */ 00013 DigitalOut relay1(D7); 00014 DigitalOut relay2(D6); 00015 DigitalOut relay3(D5); 00016 DigitalOut relay4(D4); 00017 00018 /* 00019 Toggle the relay with a period of 00020 */ 00021 int main() { 00022 while(1) { 00023 relay1 = 1; 00024 wait(0.5); // wait 0.5 sec ( 500ms) 00025 relay1 = 0; 00026 wait(0.5); // wait 0.5 sec ( 500ms) 00027 } 00028 }
Generated on Sun Jul 17 2022 08:27:34 by
1.7.2