Hallo liebes Forum
ich hätte da eine Frage bezüglich dem Verbinden von einem HC-05 Bluetooth Modul mit einem attiny45.
Vorab das Modul ist eigentlich ein Grove Modul. Somit folgende Pins zur Verfügung:
TX
RX
VCC
GND
Das ganze habe ich wie auf dem Bild gezeigt auf einem Breadboard und einem Arduino als Stromquelle zusammengesteckt.
Und folgenden Code verwendet:
#include <SoftwareSerial.h> //Software Serial Port
#define RxD 3
#define TxD 4
SoftwareSerial blueToothSerial(RxD,TxD);
void setup() {
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
setupBlueToothConnection();
}
void loop() {
char recvChar;
if(blueToothSerial.available()){//check if there's any data sent from the remote bluetooth shield
recvChar = blueToothSerial.read();
}
blueToothSerial.println("Hallo");
delay(2000);
}
void setupBlueToothConnection()
{
blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
blueToothSerial.print("\r\n+STPIN=0000\r\n");//Set SLAVE pincode"0000"
blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
delay(2000); // This delay is required.
blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable
delay(2000); // This delay is required.
blueToothSerial.flush();
}
Nun müsste das Modul zuerst Blau/Rot blinken und wenn die Verbindung steht nur Blau...
Das klappt so aber nicht.
Es blinkt nur blau, wird also nicht zum pairen freigegeben.
Wenn ich das Modul ganz normal an ein grove shield hänge klappt es wunderbar.
Wenn ich das Modul direkt an den Arduino hänge muss ich komischerweise RX und TX tauschen, dann klappt es auch.
Lediglich mit dem attiny45 bekomme ich es nicht hin.
noch ein Schaltplan vom attiny45
hätte jemand ne idee warum das nicht hinhaut? Ist doch nichts anderes als ob ich es direkt mit dem Arduino verbinde?
Danke auf jeden Fall für jeden Hinweis.
MfG SD