![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Øving 4.2 Arben og Adrian
main.cpp@0:0887fcb9e2eb, 2017-09-20 (annotated)
- Committer:
- Smashftw
- Date:
- Wed Sep 20 12:55:16 2017 +0000
- Revision:
- 0:0887fcb9e2eb
- Child:
- 1:31fe0557741c
?ving 4.2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Smashftw | 0:0887fcb9e2eb | 1 | #include "mbed.h" |
Smashftw | 0:0887fcb9e2eb | 2 | |
Smashftw | 0:0887fcb9e2eb | 3 | PwmOut myled(LED1); |
Smashftw | 0:0887fcb9e2eb | 4 | AnalogIn potmeter(p20); |
Smashftw | 0:0887fcb9e2eb | 5 | int main() |
Smashftw | 0:0887fcb9e2eb | 6 | { |
Smashftw | 0:0887fcb9e2eb | 7 | myled.period(0.02); |
Smashftw | 0:0887fcb9e2eb | 8 | while(1) { |
Smashftw | 0:0887fcb9e2eb | 9 | myled.write(potmeter); |
Smashftw | 0:0887fcb9e2eb | 10 | wait (0.1); |
Smashftw | 0:0887fcb9e2eb | 11 | } |
Smashftw | 0:0887fcb9e2eb | 12 | } |