16. Interface and application programming¶
In this week i connected my device to HC-05 Bluetooth, to my mobile phone using the app named Bluetooth Terminal HC-05
To download the app please Click Here Using Your Mobile
Code¶
to download the code please click here
View The Code
#include <SoftwareSerial.h>
#define LED 0
SoftwareSerial mySerial(6, 7); // RX, TX
void setup() {
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
pinMode(LED, OUTPUT);
}
void loop() { // run over and over
if (mySerial.available()) {
String x = mySerial.readStringUntil('\n');
x.trim();
if(x == "1") {
digitalWrite(LED, HIGH);
mySerial.println("ON");
} else {
digitalWrite(LED, LOW);
mySerial.println("OFF");
}
}
}
Picture Of The Setup¶
if i send logic 1 the led turn on
if i send logic 0 the led turn off
Group Assignment¶
Please Click Here