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 // 00004 // This is my first go at reading DigitalIn. 00005 // If pin 5 is on, I light LED1. 00006 // Thus, running a wire from pin2 (+5v) to pin5 LED 1 comes on. 00007 // Also, running the Light Dependent Resistor (LDR) that came with my SKPANG kit 00008 // from pin2 to pin5 LED1 comes on if there is light 00009 // and goes off when the LDR is covered. 00010 // 00011 00012 00013 DigitalOut myled1(LED1); 00014 DigitalIn myIn5(p5); 00015 00016 int main() 00017 { 00018 while(1) 00019 { 00020 if (myIn5) 00021 { 00022 myled1 = 1; 00023 } 00024 else 00025 { 00026 myled1 = 0; 00027 } 00028 } 00029 }
Generated on Tue Jul 12 2022 21:11:54 by
1.7.2