FRMD KL25Z <=i2c=> NXP PCF8563 (RTC) FRMD KL25Z SPI=> MCP23S17 => (GLCD) T6963C FRMD KL25Z Tsi => 3 button : <--> <enter> <++> FRMD KL25Z => Bip()

Dependencies:   TSI mbed

Fork of RTC8564NB_Clock by masa miya

Revision:
2:c271f83a69e4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bip.h	Wed May 14 04:46:52 2014 +0000
@@ -0,0 +1,25 @@
+#ifndef BIP_H
+#define BIP_H
+#include "mbed.h"
+/*  Ez egy 0.1 s hosszú 1 kHz jel alapból, meghívása: Bip(int freq, int time)
+// freki = 1 kHz * freq
+// idő   = 0.1 s * time
+// Flehsználja: PTD7 lábat
+*/
+DigitalOut bip(PTD7);
+Ticker timer;
+int v=0;
+
+void attime(){v=1;}
+
+void Bip(int freq, int time){
+    v=0;
+    timer.attach(&attime, 0.1*time); 
+    while(1){
+        bip = !bip;
+        wait(0.001/freq);  
+        if(v>0){bip = 0; return;}  
+    }   
+}
+
+#endif
\ No newline at end of file