速報APP / 工具 / Kendali Relay 1 Chanel Arduino Bluetooth

Kendali Relay 1 Chanel Arduino Bluetooth

價格:免費

更新日期:2019-05-27

檔案大小:4.3M

目前版本:1.0

版本需求:Android 4.0 以上版本

官方網站:mailto:agunghariwahyudi002@gmail.com

Kendali Relay 1 Chanel Arduino Bluetooth(圖1)-速報App

Wiring Diagram

Arduino dengan Bluetooth HC05

Arduino----------Bluetooth HC05

Tx----------------Rx

Rx----------------Tx

5V----------------5V

GND---------------GND

Arduino dengan Relay 1 Chanel

Arduino---------------Relay

2-----------------Relay 1

5V----------------5V

GND---------------GND

Relay menggunakan aktif LOW

Sketch Arduino

int DataBluetooth;

void setup() {

Kendali Relay 1 Chanel Arduino Bluetooth(圖2)-速報App

Serial.begin(9600);

pinMode(2,OUTPUT); //Relay 1

digitalWrite(2,HIGH);

}

void loop() {

if (Serial.available()){

DataBluetooth=Serial.read();

// Menyalakan Relay 1

if(DataBluetooth=='A'){

digitalWrite(2,LOW);

}

//Mematikan Relay 1

if(DataBluetooth=='B'){

digitalWrite(2,HIGH);

}

}

Kendali Relay 1 Chanel Arduino Bluetooth(圖3)-速報App

}