Attiny 85 send data with Bluetooth HC-05

Hello all, i have attiny85 with bluetooth hc 05, i want to use attiny85 to send data via bluetooth hc 05 (for example 0 and 1) and received by bluetooth hc 05 with arduino uno, i have been searching where no way how to make it and its program. anyone know the program for sending data with attiny85 via bluetooth hc 05? Thank you.

The attiny85 doesn't have hardware serial, but it can use SoftwareSerial.

If using my ATTinyCore (link in sig) there's also a builtin software serial named Serial on the AIN0 and AIN1 pins (see the documentation included with the core for the details).

Either way it is a software serial implementation, so keep baud rates low and don't try to send and receive at the same time.

I’ve done that and this is the program.
But when sending data does not happen in the receiver.
what’s wrong with the program?
thank you.

#include <SoftwareSerial.h> //Software Serial Port
#define button 5
#define RxD 1
#define TxD 2

#define DEBUG_ENABLED 1

SoftwareSerial blueToothSerial(RxD,TxD);

int buttonState = 0;

void setup() {
  pinMode(button, INPUT);
  pinMode(RxD, INPUT);
  pinMode(TxD, OUTPUT);
  Serial.begin(9600); // Default communication rate of the Bluetooth module
}

void loop() {
  delay(100);
  buttonState = digitalRead(button);
  if (buttonState == HIGH) {
  Serial.print('1'); // Sends '1' to serialout
  }
  else {
  Serial.print('0');
  }
}

I want to send data using Attiny85 via Bluetooth HC-05 with this program, but in serial monitor nothing happened. what’s wrong with this program?

#include <SoftwareSerial.h> //Software Serial Port
#define button 5
#define RxD 1
#define TxD 2


SoftwareSerial blueToothSerial(RxD,TxD);

int buttonState = 0;

void setup() {
  pinMode(button, INPUT);
  pinMode(RxD, INPUT);
  pinMode(TxD, OUTPUT);
  Serial.begin(9600); // Default communication rate of the Bluetooth module
}

void loop() {
  delay(100);
  buttonState = digitalRead(button);
  if (buttonState == HIGH) {
  Serial.print('1'); // Sends '1' to serialout
  }
  else {
  Serial.print('0');
  }
}

It seems that you are just sending a message, and I think Serial.print("1") is more common form, not Serial.print('1').

Nick_Pyner: It seems that you are just sending a message, and I think Serial.print("1") is more common form, not Serial.print('1').

Both really ought to work.

Are TX and RX connected right? They cross over, ie, TX to RX, RX to TX. Are ground of bluetooth module and tiny85 connected? Are you sure your button is wired the way you think it is?