Back to Browse

Voice controlled Home automation

231 views
Jul 16, 2021
5:24

-Its a project on home automation. using ardiuno -To order this kit go to my previous video https://youtu.be/IEbKa9Zf3rc -previous video link-- -https://youtu.be/dmgepWok9r0 -(coad)--- #define fan 2 #define bulb 3 void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(fan, OUTPUT); pinMode(bulb, OUTPUT); } void loop() { // put your main code here, to run repeatedly: if(Serial.available() == 1) { String val = Serial.readString(); Serial.println(val); if(val == "fan on") { digitalWrite(fan, HIGH); } if(val == "fan off") { digitalWrite(fan, LOW); } if(val == "bulb on") { digitalWrite(bulb, HIGH); } if(val == "bulb off") { digitalWrite(bulb, LOW); } if(val == "all on6") { digitalWrite(fan, HIGH); digitalWrite(bulb, HIGH); } if(val == "all off") { digitalWrite(bulb, LOW); digitalWrite(fan, LOW); } } }

Download

0 formats

No download links available.

Voice controlled Home automation | NatokHD