Posts

Showing posts with the label hc-05

Attiny85 + HC05 - Connection test with source code

In today's tutorial, we'll show you how to test the connection between the bluetooth module HC-05 and the AtTiny85 chip based on simple character transmission via the Android phone terminal application. The attached program for AtTiny85 can be used for any chip from the AtTiny AtMega family. It can only be different in selected digital pins. # define RX 3 # define TX 4 # define pinLED 0 # include < SoftwareSerial.h > SoftwareSerial bluetooth (TX, RX); void setup () { bluetooth. begin ( 9600 ); pinMode (pinLED, OUTPUT); } void loop () { byte BluetoothData; if (bluetooth. available () > 0 ) { BluetoothData=bluetooth. read (); switch (BluetoothData) { case ' 0 ' : digitalWrite (pinLED, LOW); bluetooth. println ( " Turning LED OFF. " ); break ; case ' 1 ' : digitalWrite (pinLED, HIGH); bluetooth. println ( " Turning LED ON. " );