Hi guys
I am trying to setup a sodaq explorer board to communicate in 300,e,7,1 as described at the section “Parameters” in the Arduino Reference https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/
The board seems to not be responding to such configuration .
The same sketch run fine on a Arduino Mega (changind port names obviously).
Sodaq sketch:
#include "Arduino.h"`
#define debugSerial SerialUSB
#define SerialPort Serial
//#define AL
#define AC
#if defined AC
int BaudRate = 300;
int BitsParityStop = SERIAL_7E1; // ---->this setup only work in arduino mega sketch, not here in sodaq explorer
#elif defined AL
int BaudRate = 1200;
int BitsParityStop = SERIAL_8N1;
#endif
void setup() {
while ((!debugSerial) && (millis() < 10000)){
// wait 10 seconds for serial monitor
}
debugSerial.begin(115200);
SerialPort.begin (BaudRate,BitsParityStop); // Inicializo el puerto serial
}
void loop() {
//send and receive data with serial
if (debugSerial.available()){
while (debugSerial.available()) {
uint8_t inChar = debugSerial.read();
SerialPort.write(inChar);
}
}
if (SerialPort.available()){
while (SerialPort.available()) {
uint8_t inChar = SerialPort.read();
debugSerial.write(inChar);
}
}
}
Arduino Mega Sketch (Working fine)
#include "Arduino.h"
#define debugSerial Serial
#define SerialPort Serial1
//#define AL
#define AC
#if defined AC
int BaudRate = 300;
int BitsParityStop = SERIAL_7E1; ---->this setup only work fine here in the arduino mega sketch
#elif defined AL
int BaudRate = 1200;
int BitsParityStop = SERIAL_8N1; //
#endif
void setup() {
while ((!debugSerial) && (millis() < 10000)){
}
debugSerial.begin(115200);
SerialPort.begin (BaudRate,BitsParityStop); // Inicializo el puerto serial
}
void loop() {
//send and receive data with serial
if (debugSerial.available()){
while (debugSerial.available()) {
uint8_t inChar = debugSerial.read();
SerialPort.write(inChar);
}
}
if (SerialPort.available()){
while (SerialPort.available()) {
uint8_t inChar = SerialPort.read();
debugSerial.write(inChar);
}
}
}
Can tell me how to see the library that process the parameters to check if is correctly implemented?
Or what suggest to solve this issue?
THanks in advance.