Projectgroep 20 Biorobotics
/
Lampje
now when you turn the draaiknop the lampje will dim
Diff: main.cpp
- Revision:
- 0:ead43c4234c9
- Child:
- 1:c6776cafbfd9
diff -r 000000000000 -r ead43c4234c9 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 19 14:12:56 2017 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" + + +AnalogIn But2(A2); +AnalogIn But1(A3); +AnalogIn Pot1(A1); +DigitalOut gpo(D0); +PwmOut led2(D6); +PwmOut led1(D5); +float PwmPeriod= 1/5000.0; + +int main() +{ + led2.period(PwmPeriod); + while (true) { + led2= Pot1.read(); + wait(0.1f); + } +}