Mace Robotics
New member
Hello,
I use Teensys 3.5 and a serial IMU. My program work with SoftwareSerial but no with Serial2.
I use 9 and 10 pins (serial 2 on teensys 3.5)
Can anyone provide help for this problem ? thanks.
Code with Serial2 :
Code with SoftwareSerial :
Thanks.
I use Teensys 3.5 and a serial IMU. My program work with SoftwareSerial but no with Serial2.
I use 9 and 10 pins (serial 2 on teensys 3.5)
Can anyone provide help for this problem ? thanks.
Code with Serial2 :
Code:
#define CMPS12 Serial2
const byte rxPin = 9;
const byte txPin = 10;
void IMU_init(void)
{
Serial.println("Init IMU...");
delay(1000);
CMPS12.setRX(rxPin);
CMPS12.setTX(txPin);
CMPS12.begin(9600);
// BAUD 38400
CMPS12.write(0xA1);
delay(500);
CMPS12.begin(38400);
}
Code with SoftwareSerial :
Code:
SoftwareSerial CMPS12 = SoftwareSerial(9,10);
void IMU_init(void)
{
Serial.println("Init IMU...");
delay(1000);
//CMPS12.setRX(rxPin);
//CMPS12.setTX(txPin);
CMPS12.begin(9600);
// BAUD 38400
CMPS12.write(0xA1);
delay(500);
CMPS12.begin(38400);
}
Thanks.