I am trying to solve the Flexserial library usage on a Teensy 4.1 with pins 2,3,4,5 as serial outputs, to communicate at 9600 BAUD with an APC220 connected on either of the four pins.
I am getting question marks on the receiving APC220 which implies that there is a baud rate issue. If I connect serial1 then the text is clear and the link radio link functions.
This is my code
I am getting question marks on the receiving APC220 which implies that there is a baud rate issue. If I connect serial1 then the text is clear and the link radio link functions.
This is my code
Code:
#include <FlexIO_t4.h>
#include <FlexSerial.h>
#define TX_PIN 3
#define TX_FLEX_IO_INDEX 0
#define TX_FLEX_IO_TIMER 0
#define TX_FLEX_IO_SHIFTER 0
#define TX_PIN2 4
#define TX_FLEX_IO_INDEX2 0
#define TX_FLEX_IO_TIMER2 1
#define TX_FLEX_IO_SHIFTER2 1
FlexSerial SerialFlex(-1, TX_PIN, -1, -1, -1, TX_FLEX_IO_INDEX, TX_FLEX_IO_TIMER, TX_FLEX_IO_SHIFTER);
FlexSerial SerialFlex2(-1, TX_PIN2, -1, -1, -1, TX_FLEX_IO_INDEX2, TX_FLEX_IO_TIMER2, TX_FLEX_IO_SHIFTER2);
void setup() {
pinMode(13, OUTPUT);
while (!Serial && millis() < 4000);
Serial.begin(9600);
Serial1.begin(9600);
delay(500);
SerialFlex.begin(9600);
SerialFlex2.begin(9600);
}
void loop()
{
Serial.println ("Line Transmitted");
Serial1.println("Sending A Transmission on Serial1");
SerialFlex.print("Sending A Transmission on Flex");
SerialFlex2.print("Sending A Transmission on Flex 2");
delay(1000);
}
Last edited by a moderator: