Example Code for Arduino-RS232 Communication
Last revision 2025/12/26
This article offers a practical example of Arduino-RS232 communication, demonstrating how LattePanda Alpha & Delta can communicate with Arduino using an expansion board, complete with code examples and implementation guidance.
Hardware Preparation
- DFR0216 DFRduino UNO R3 (or similar) x 1
- DFR0258 Arduino RS232 Shield x1 (DFR0258)
- DFR0545 LattePanda Alpha & Delta x 1
- DFR0778 LattePanda Alpha & Delta RS232 Shield x1
- RS232 Male/Female Data Cable x1
Software Preparation
- Download Arduino IDE: Click to download Arduino IDE
- Download driver: Download driver
Note: the driver needs to be installed when using on Windows for the first time. There is no need to install driver in Linux system.
Connection
- Connect the Arduino RS232 expansion board to the Arduino main control board
- Connect the LattePanda Alpha&Delta RS232 interface expansion board to the LattePanda Alpha&Delta
- Use the RS232 data cable to connect them together, as shown in the picture below:
Sample Code
Burn the following code in Arduino:
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while(!Serial);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()>0){
char a;
a = Serial.read()+1;
Serial.print(a); //return all the data that received from LP
}
}
Result
Open the serial monitor on LattePanda, select the COM1 serial port, and set the baud rate to 115200. Send data to Arduino will returned with added 1.

Was this article helpful?
