Skip to content

Updating the Baud Rate (Serial)

derekisbusy edited this page Oct 19, 2015 · 1 revision

The default baud rate that JArduino uses when communicating over serial connections is 9600. This baud rate can be updated if needed. The most common baud rates are 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, and 115200. However most Arduinos can support a baud rate of up to 1-2Mbps. And the new Arduino 101 with Intel's Curie chip may go up to 4Mpbs.

The baud rate can be changed by passing a SerialConfiguration object to the constructor in your Java class that extends from the JArduino class. For example in the blink demo you would call the constructor as follows.

JArduino arduino = new Blink(serialPort, new SerialConfiguration(115200));

You will also need to update the code on the Arduino to match the baud rate set in your Java class.

void setup()
{
	// initialize the JArduino protocol
	_JArduino.init_JArduino(115200);
}
Clone this wiki locally