test ldr
Dependencies: mbed
Revision 0:58de832a264e, committed 2018-10-16
- Comitter:
- mark1998
- Date:
- Tue Oct 16 10:46:55 2018 +0000
- Commit message:
- LDR Test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 58de832a264e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 16 10:46:55 2018 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +DigitalIn lDR(p7); +DigitalOut myled (LED1); +DigitalOut myled2(LED2); + +int main() { + while(1) { + if(lDR ==1){ + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } + else{ + myled2=1; + wait(0.5); + myled2=0; + wait(1); + break; + } + +} +} \ No newline at end of file
diff -r 000000000000 -r 58de832a264e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Oct 16 10:46:55 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file