Hi. Does anyone have any ideas as to why the HC-05 bluetooth modules would have the transmission speed get slower after the modules have been connected for a while ?
Everything works fine when they are first powered on and they have basically a 1/2 second delay in transmission. If they are on and connected for 5 minutes, this time increases to 3 seconds and it gets worse, the longer they stay connected.
If I power off either one of the Hc-05 modules for a few seconds and turn it back on, then everything is back up to speed .
the 2 modules and atmega16 are set at 9600 baud. the atmega16 are both at 1mhz internal clock speed.
Thanks
#include "header.h"
const int LED_BKL = 16; // BACKLIGHT
const int PIN_M = 2; // MOTOR 7
const int SW_UP = 31; // UP SWITCH
int state = 0;
void setup() {
pinMode(LED_BKL, OUTPUT);
pinMode(PIN_M, OUTPUT);
pinMode(SW_UP, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
if(Serial.available() > 0){
state = Serial.read();
}
if (state == 'A') {
digitalWrite(LED_BKL, HIGH);
}
if (state == '0') {
digitalWrite(LED_BKL, LOW);
}
if (digitalRead(SW_UP) == LOW) {
Serial.write('B');
digitalWrite(PIN_M, HIGH);
}
if (digitalRead(SW_UP) == HIGH) {
Serial.write('0');
digitalWrite(PIN_M, LOW);
}
}