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.
Dependencies: mbed
Fork of 3BHEL_LDR by
Revision 1:987bbbdbcedf, committed 2016-06-09
- Comitter:
- PosztosAlex
- Date:
- Thu Jun 09 14:27:31 2016 +0000
- Parent:
- 0:4a51d86e4cbd
- Commit message:
- Pr?fung 9.06.2016
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jan 21 15:01:53 2016 +0000 +++ b/main.cpp Thu Jun 09 14:27:31 2016 +0000 @@ -1,23 +1,23 @@ #include "mbed.h" -AnalogIn LDR(p16); - +AnalogIn POTI(p15); BusOut myled(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1); Serial pc(USBTX,USBRX); int main() { while(1) { - // myled=LDR.read_u16()/64; - pc.printf("\r%u %f\n", (LDR.read_u16()/62), LDR.read()); - wait(0.1); + + pc.printf(" %f\n", POTI.read()); - int licht= LDR.read_u16()/64; + + int poti= POTI.read() *10; myled = 0; - for(int i = 0 ;i < licht / 75; i++ ) + for(int i = 0 ;i < poti ; i++ ) { - myled = 0b1<<i | myled ; - } + myled = 0b1<<i ; + } + wait_ms(10); } } \ No newline at end of file