So I need to take 8 analog inputs and send them from one of the arduinos and then receive it at the other arduino and send it to PWM outputs with a range of 0-180. Before I do this I tried to send a byte and I can't get it to work.
The HC-05 modules are programmed using AT commands for one as a master and one as a slave. Both can pair with each other automatically and have the same baud/stop/parity of 38,000/0/0.
My code for the master arduino is:
#include <SoftwareSerial.h>
SoftwareSerial BT(19,18);
void setup()
{
Serial.begin(38400);
BT.begin(38400);
}
void loop()
{
byte c = ',';
BT.write(c);
delay(5);
}
My code for the Slave arduino is:
#include <SoftwareSerial.h>
SoftwareSerial BT(19,18);
byte c;
void setup()
{
Serial.begin(38400);
BT.begin(38400);
}
void loop()
{
if (BT.available())
{
c = BT.read();
Serial.println(c);
}
delay(2000);
}
I've tried changing both data types to char, int, uint8_t, and nothing works. Also tried changing the baud rates of both the serial monitor and the bluetooth modules and nothing there either. Can anyone spot something weird since this is my first time ever programming bluetooth modules and arduinos.