Matthaeus Vorraber
/
LPC1768PWM
disco
Revision 3:94c2e091f621, committed 2019-12-09
- Comitter:
- happy_alien
- Date:
- Mon Dec 09 18:23:30 2019 +0000
- Parent:
- 2:1e4e820dfe2b
- Commit message:
- pwm rgb
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1e4e820dfe2b -r 94c2e091f621 main.cpp --- a/main.cpp Mon Dec 09 17:29:12 2019 +0000 +++ b/main.cpp Mon Dec 09 18:23:30 2019 +0000 @@ -1,13 +1,22 @@ #include "mbed.h" -AnalogOut Aout(p18); // Kopfhörer -AnalogIn pot1(p19); +PwmOut red(p23); +PwmOut green(p24); +PwmOut blue(p25); int main() { - while(1) { - Aout = pot1.read(); // Lautstärke - wait_us(1000); // Frequenz - Aout = 0; - wait_us(1000); - } -} + red=1; + green=1; + blue=1; + while(1) + { + red=red-0.01; + wait_ms(50); + green=green-0.01; + wait_ms(50); + blue=blue-0.01; + wait_ms(50); + + + } +} // Leds ausschalten \ No newline at end of file