Matthaeus Vorraber
/
LPC1768tones
tones
Diff: main.cpp
- Revision:
- 2:1e4e820dfe2b
- Parent:
- 1:5c4893846635
--- a/main.cpp Mon Nov 25 18:12:42 2019 +0000 +++ b/main.cpp Mon Dec 09 17:29:12 2019 +0000 @@ -1,29 +1,13 @@ -#define BUTTON1 p14 #include "mbed.h" -// Flash an LED while a DigitalIn is true - -DigitalIn enable(p14); -BusOut leds(LED1,LED2,LED3,LED4); -BusOut rgb(p23,p24,p15); -BusIn joy(p12,p13,p14,p15,p16); - - - + +AnalogOut Aout(p18); // Kopfhörer +AnalogIn pot1(p19); int main() { - while(1) { - - if(leds==0) - { - leds=1; - rgb=255; - } - else - - leds=leds<<1; - rgb=rgb+1; - - wait_ms(200); + Aout = pot1.read(); // Lautstärke + wait_us(1000); // Frequenz + Aout = 0; + wait_us(1000); } - } +}