Control Fan speed

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
devilal2101
Date:
Tue Sep 03 10:00:08 2019 +0000
Commit message:
control Fan speed complete.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 0af9d6fdeb4e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 03 10:00:08 2019 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+ 
+InterruptIn button(D2);
+DigitalOut led(D13);
+DigitalOut triacPulse(D5);
+ 
+void fire_angle() {
+    wait_ms(5);
+    triacPulse= 1;
+    wait_us(50);  
+    // delay 50 uSec on output pulse to turn on triac
+    triacPulse = 0;
+}
+ 
+int main() {
+    button.fall(&fire_angle);
+    while(1) { 
+        led = !led;
+        wait(1);
+        
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 0af9d6fdeb4e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 03 10:00:08 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file