Arduino Forum

Using Arduino => Interfacing w/ Software on the Computer => Topic started by: gab27 on Nov 20, 2018, 08:24 am

Title: Rosserial baudrate
Post by: gab27 on Nov 20, 2018, 08:24 am
Hi,

does someone know where the baud rate is defined? I look in ArduinoHardware.h, and in the package rosserial_python in serial_node and serial_client. I have changed them but default is always 57600. And yes I know I can define it:
Code: [Select]
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=250000


And second: Is it correct that it works with different baudrates, not just one? And what's the maximum baudrate for an arudino zero?

Thanks
Title: Re: Rosserial baudrate
Post by: Perehama on Nov 20, 2018, 02:25 pm
For the Zero, it is defined in the ArduinoCore-samd, HardwareSerial.h (https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/HardwareSerial.h), Uart.h (https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/Uart.h) and Uart.cpp (https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/Uart.cpp). You can change it by the command Serial.begin() (https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/), SerialUSB.begin(), or Serial1.begin().