![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
new pin
Fork of DigitalOut by
main.cpp@3:3d1b403e5990, 2016-09-19 (annotated)
- Committer:
- lukmiros
- Date:
- Mon Sep 19 15:31:05 2016 +0000
- Revision:
- 3:3d1b403e5990
- Parent:
- 2:a61141b172c0
- Child:
- 4:54b602d62d1f
Two diodes flashing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marcel1691 | 0:3ec5cf718e17 | 1 | /** Mittels DigitalOut kann eine Positive Spannung an einem Pin erzeugt werden. |
marcel1691 | 0:3ec5cf718e17 | 2 | */ |
marcel1691 | 0:3ec5cf718e17 | 3 | #include "mbed.h" |
marcel1691 | 0:3ec5cf718e17 | 4 | |
lukmiros | 2:a61141b172c0 | 5 | DigitalOut led( D11 ); |
lukmiros | 3:3d1b403e5990 | 6 | DigitalOut led2( D13 ); |
marcel1691 | 0:3ec5cf718e17 | 7 | |
marcel1691 | 0:3ec5cf718e17 | 8 | int main() |
marcel1691 | 0:3ec5cf718e17 | 9 | { |
marcel1691 | 0:3ec5cf718e17 | 10 | while(1) |
marcel1691 | 0:3ec5cf718e17 | 11 | { |
marcel1691 | 0:3ec5cf718e17 | 12 | led.write( 0 ); |
lukmiros | 3:3d1b403e5990 | 13 | led2.write(0); |
marcel1691 | 0:3ec5cf718e17 | 14 | wait(0.8); |
marcel1691 | 0:3ec5cf718e17 | 15 | |
marcel1691 | 0:3ec5cf718e17 | 16 | led.write( 1 ); |
lukmiros | 3:3d1b403e5990 | 17 | led2.write( 1 ); |
marcel1691 | 0:3ec5cf718e17 | 18 | wait(1.0); |
marcel1691 | 0:3ec5cf718e17 | 19 | } |
marcel1691 | 0:3ec5cf718e17 | 20 | } |