tones

Dependencies:   mbed

Committer:
happy_alien
Date:
Mon Nov 25 18:12:42 2019 +0000
Revision:
1:5c4893846635
Parent:
0:1b90d953ef92
Child:
2:1e4e820dfe2b
lauflicht,rgb

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fpucher 0:1b90d953ef92 1 #define BUTTON1 p14
fpucher 0:1b90d953ef92 2 #include "mbed.h"
fpucher 0:1b90d953ef92 3 // Flash an LED while a DigitalIn is true
fpucher 0:1b90d953ef92 4
happy_alien 1:5c4893846635 5 DigitalIn enable(p14);
happy_alien 1:5c4893846635 6 BusOut leds(LED1,LED2,LED3,LED4);
happy_alien 1:5c4893846635 7 BusOut rgb(p23,p24,p15);
happy_alien 1:5c4893846635 8 BusIn joy(p12,p13,p14,p15,p16);
happy_alien 1:5c4893846635 9
happy_alien 1:5c4893846635 10
happy_alien 1:5c4893846635 11
fpucher 0:1b90d953ef92 12
fpucher 0:1b90d953ef92 13 int main() {
happy_alien 1:5c4893846635 14
fpucher 0:1b90d953ef92 15 while(1) {
happy_alien 1:5c4893846635 16
happy_alien 1:5c4893846635 17 if(leds==0)
happy_alien 1:5c4893846635 18 {
happy_alien 1:5c4893846635 19 leds=1;
happy_alien 1:5c4893846635 20 rgb=255;
fpucher 0:1b90d953ef92 21 }
happy_alien 1:5c4893846635 22 else
happy_alien 1:5c4893846635 23
happy_alien 1:5c4893846635 24 leds=leds<<1;
happy_alien 1:5c4893846635 25 rgb=rgb+1;
happy_alien 1:5c4893846635 26
happy_alien 1:5c4893846635 27 wait_ms(200);
fpucher 0:1b90d953ef92 28 }
happy_alien 1:5c4893846635 29 }