i am communicating easily with arduino uno board with hc05 but when i make it with standalone board atmega 328p its not communicating i have checked the standalone board with other programs and its working good.
The following programis here
#include <SoftwareSerial.h>// import the serial library
SoftwareSerial puniBT(10, 11); // RX, TX
int ledpin=13; // led on D13 will show blink on / off
int BluetoothData; // the data given from Computer
void setup() {
// put your setup code here, to run once:
puniBT.begin(9600);
puniBT.println("Bluetooth On please press 1 or 0 blink LED ..");
pinMode(ledpin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (puniBT.available()){
BluetoothData=puniBT.read();
if(BluetoothData=='1'){ // if number 1 pressed ....
digitalWrite(ledpin,1);
puniBT.println("LED On D13 ON ! ");
}
if (BluetoothData=='0'){// if number 0 pressed ....
digitalWrite(ledpin,0);
puniBT.println("LED On D13 Off ! ");
}
}
delay(100);// prepare for next data ...
}
please help me out.
![]()
punibt.ino (801 Bytes)