fabian lutscht :o

Dependencies:   mbed

Committer:
p0ckin3d
Date:
Wed May 28 12:15:21 2014 +0000
Revision:
0:16e4a044f776
Child:
1:69b163b1e72d
Fabian ist gay.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
p0ckin3d 0:16e4a044f776 1 #include "mbed.h"
p0ckin3d 0:16e4a044f776 2
p0ckin3d 0:16e4a044f776 3 BusOut rgb(p23, p24, p25);
p0ckin3d 0:16e4a044f776 4 InterruptIn button(p14);
p0ckin3d 0:16e4a044f776 5 PwmOut speaker(p26);
p0ckin3d 0:16e4a044f776 6
p0ckin3d 0:16e4a044f776 7 void start()
p0ckin3d 0:16e4a044f776 8 {
p0ckin3d 0:16e4a044f776 9 for(unsigned char i=0; i < 4; i++)
p0ckin3d 0:16e4a044f776 10 {
p0ckin3d 0:16e4a044f776 11 rgb = ~0x02;
p0ckin3d 0:16e4a044f776 12 wait(1);
p0ckin3d 0:16e4a044f776 13 rgb = 0xFF;
p0ckin3d 0:16e4a044f776 14 wait(1);
p0ckin3d 0:16e4a044f776 15 }
p0ckin3d 0:16e4a044f776 16 rgb = ~0x03;
p0ckin3d 0:16e4a044f776 17 wait(3);
p0ckin3d 0:16e4a044f776 18 rgb = ~0x01;
p0ckin3d 0:16e4a044f776 19 for(unsigned char i = 0; i < 50; i++)
p0ckin3d 0:16e4a044f776 20 {
p0ckin3d 0:16e4a044f776 21 speaker.write(0.9);
p0ckin3d 0:16e4a044f776 22 wait(0.1);
p0ckin3d 0:16e4a044f776 23 speaker.write(0.0);
p0ckin3d 0:16e4a044f776 24 wait(0.1);
p0ckin3d 0:16e4a044f776 25 }
p0ckin3d 0:16e4a044f776 26 speaker.write(0.0);
p0ckin3d 0:16e4a044f776 27 rgb = ~0x03;
p0ckin3d 0:16e4a044f776 28 t_speaker.detach();
p0ckin3d 0:16e4a044f776 29 speaker.write(0.0);
p0ckin3d 0:16e4a044f776 30 wait(3);
p0ckin3d 0:16e4a044f776 31 rgb = ~0x02;
p0ckin3d 0:16e4a044f776 32 }
p0ckin3d 0:16e4a044f776 33
p0ckin3d 0:16e4a044f776 34
p0ckin3d 0:16e4a044f776 35 int main() {
p0ckin3d 0:16e4a044f776 36 button.rise(&start);
p0ckin3d 0:16e4a044f776 37 speaker.period_us(1000);
p0ckin3d 0:16e4a044f776 38 rgb = ~0x02;
p0ckin3d 0:16e4a044f776 39 while(1) {
p0ckin3d 0:16e4a044f776 40
p0ckin3d 0:16e4a044f776 41 }
p0ckin3d 0:16e4a044f776 42 }