Hi, I would like to ask if it is possible to setup two transmitters with one receivers using the Manchester library. I know that transmitters cannot send simultaneously, but somehow, there is already an error when only one of the transmitters actually sends anything. I am using two ATTiny85s as the transmitters and an Arduino UNO as the receiver.
Currently, I am testing this very simple setup: Both Transmitters are set up, but only one transmits data, the number 12, every 80 ms. The Arduino UNO receives the data and prints it on the Serial Monitor. If I have both ATTiny85s plugged in, the UNO never receives data, but if the ATTiny that doesn't send anything is unplugged, the UNO is able to get the data.
So the question is: Is it possible to even have man.setupTransmit(TX_PIN, MAN_1200);
in two different boards connected to the same receiver? That seems to be what is causing the problem.
Connections:
ATTiny85 PIN0 -> UNO PIN3
ATTiny85 PIN0 -> UNO PIN3
VCC and GND are connected between the three boards.
Code:
//Transmitter 1 (ATTiny85)
#include <Manchester.h>
#define TX_PIN 0
void setup() {
man.setupTransmit(TX_PIN, MAN_1200)
}
void loop() {
man.transmit(12); //Arbitrary number to send
delay(80);
}
//Transmitter 2 (ATTiny85)
#include <Manchester.h>
#define TX_PIN 0
void setup() {
man.setupTransmit(TX_PIN, MAN_1200)
}
void loop() {
//Just not doing anything at all
}
//Receiver (Arduino UNO)
#include <Manchester.h>
#define RX_PIN 3
void setup() {
man.setupReceive(RX_PIN, MAN_1200);
man.beginReceive();
Serial.begin(9600);
}
void loop() {
if (man.receiveComplete()) {
int message = man.getMessage();
man.beginReceive();
Serial.println(message);
}
}