part 6 done.
Dependencies: mbed
Fork of PwmOut_HelloWorld by
main.cpp@2:7481c04acf7f, 2015-09-05 (annotated)
- Committer:
- ycai47
- Date:
- Sat Sep 05 19:40:05 2015 +0000
- Revision:
- 2:7481c04acf7f
- Parent:
- 1:5160ea45399b
lab2 part6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:50d2b9c62765 | 1 | #include "mbed.h" |
mbedAustin | 1:5160ea45399b | 2 | |
ycai47 | 2:7481c04acf7f | 3 | PwmOut control(p26); |
mbedAustin | 1:5160ea45399b | 4 | |
mbed_official | 0:50d2b9c62765 | 5 | int main() { |
ycai47 | 2:7481c04acf7f | 6 | while(1) { |
ycai47 | 2:7481c04acf7f | 7 | for(float p = 0.0f; p < 1.0f; p += 0.1f) { |
ycai47 | 2:7481c04acf7f | 8 | control.write(p); |
ycai47 | 2:7481c04acf7f | 9 | wait(5.0); |
ycai47 | 2:7481c04acf7f | 10 | } |
ycai47 | 2:7481c04acf7f | 11 | } |
mbed_official | 0:50d2b9c62765 | 12 | } |