I have a piece of code that works perfectly fine for Arduino uno and micro, however trying to get it to work for Teensy LC has been hell.
The goal is to have the Arduino communicate to the Teensy LC using the HC-12 long range transmitter/transceiver module. and this tutorial
Code that works for Arduino, needs translation for Teensy, I'll spare you my hopeless attempts:
The RX and TX pin of the HC-12 are connected respectively to pin 0 and 1 on the Teensy.
I'm asking your help for the software side of things.
The goal is to have the Arduino communicate to the Teensy LC using the HC-12 long range transmitter/transceiver module. and this tutorial
Code that works for Arduino, needs translation for Teensy, I'll spare you my hopeless attempts:
Code:
/* Arduino Long Range Wireless Communication using HC-12
Example 01
by Dejan Nedelkovski, www.HowToMechatronics.com
*/
#include <SoftwareSerial.h>
SoftwareSerial HC12(0, 11); // HC-12 TX Pin, HC-12 RX Pin
void setup() {
Serial.begin(9600); // Serial port to computer
HC12.begin(9600); // Serial port to HC12
}
void loop() {
while (HC12.available()) { // If HC-12 has data
Serial.write(HC12.read()); // Send the data to Serial monitor
}
while (Serial.available()) { // If Serial monitor has data
HC12.write(Serial.read()); // Send that data to HC-12
}
}
The RX and TX pin of the HC-12 are connected respectively to pin 0 and 1 on the Teensy.
I'm asking your help for the software side of things.