#include <SoftwareSerial.h>
#define BT_RXD 8
#define BT_TXD 7
SoftwareSerial bluetooth(BT_RXD, BT_TXD);
void setup(){
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop(){
if (bluetooth.available()) {
Serial.write(bluetooth.read());
}
if (Serial.available()) {
bluetooth.write(Serial.read());
}
}
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(8, 9); // 8번 TX, 9번 RX
void setup()
{
Serial.begin(9600);
bluetooth.begin(9600);
pinMode(3, OUTPUT); // LED OUTPUT
pinMode(5, OUTPUT); // LED OUTPUT
}
void loop()
{
char val = bluetooth.read();
if (bluetooth.available())
{
Serial.write(bluetooth.read());
}
if(val == 'a')
{
digitalWrite(3,HIGH);
}
if(val == 'b')
{
digitalWrite(5, HIGH);
}
else if(val == 'c')
{
digitalWrite(3, LOW);
digitalWrite(5, LOW);
}
}