![](/media/cache/group/ep.webp.50x50_q85.jpg)
Pulsweitenmodulation - Generieren eines x Hz Tones mittels PWM
Dependencies: mbed
Fork of PwmOut by
main.cpp@0:06b1d306796f, 2015-03-23 (annotated)
- Committer:
- marcel1691
- Date:
- Mon Mar 23 13:47:51 2015 +0000
- Revision:
- 0:06b1d306796f
- Child:
- 1:4842c28f7ee3
Pulsweitenmodulation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marcel1691 | 0:06b1d306796f | 1 | /** Pulsweitenmodulation |
marcel1691 | 0:06b1d306796f | 2 | */ |
marcel1691 | 0:06b1d306796f | 3 | #include "mbed.h" |
marcel1691 | 0:06b1d306796f | 4 | |
marcel1691 | 0:06b1d306796f | 5 | PwmOut led( D13 ); |
marcel1691 | 0:06b1d306796f | 6 | |
marcel1691 | 0:06b1d306796f | 7 | int main() |
marcel1691 | 0:06b1d306796f | 8 | { |
marcel1691 | 0:06b1d306796f | 9 | for ( float i = 0.0; i < 1.0f; i += 0.01f ) |
marcel1691 | 0:06b1d306796f | 10 | { |
marcel1691 | 0:06b1d306796f | 11 | led = i; |
marcel1691 | 0:06b1d306796f | 12 | wait ( 0.1 ); |
marcel1691 | 0:06b1d306796f | 13 | } |
marcel1691 | 0:06b1d306796f | 14 | } |