fabian lutscht :o

Dependencies:   mbed

Revision:
0:16e4a044f776
Child:
1:69b163b1e72d
diff -r 000000000000 -r 16e4a044f776 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed May 28 12:15:21 2014 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+
+BusOut rgb(p23, p24, p25);
+InterruptIn button(p14);
+PwmOut speaker(p26);
+
+void start()
+{
+    for(unsigned char i=0; i < 4; i++)
+    {
+        rgb = ~0x02;
+        wait(1);
+        rgb = 0xFF;
+        wait(1);
+    }
+    rgb = ~0x03;
+    wait(3);
+    rgb = ~0x01;
+    for(unsigned char i = 0; i < 50; i++)
+    {
+        speaker.write(0.9);
+        wait(0.1);
+        speaker.write(0.0);
+        wait(0.1);
+    }
+    speaker.write(0.0);
+    rgb = ~0x03;
+    t_speaker.detach();
+    speaker.write(0.0);
+    wait(3);
+    rgb = ~0x02;
+}
+
+
+int main() {
+    button.rise(&start);
+    speaker.period_us(1000);
+    rgb = ~0x02;
+    while(1) {
+
+    }
+}