Rock 4SE Tutorial
Last revision 2026/01/13
This tutorial provides a step-by-step guide to setting up the Rock 4SE controller board for Python programming, including hardware and software preparation, enabling I2C7, and running sample code on the RGB LCD KeyPad HAT. Learn how to navigate the Python examples directory and execute programs to display outputs on the LCD.
Hardware Preparation
- Rock 4SE Controller Board x 1
- RGB LCD KeyPad HAT x1
- HDMI Cable x1
- Display x1
- Keyboard and Mouse x1
Software Preparation
- Rock 4SE OS
- Install libmraa: Follow Radxa's libmraa guide
- Install smbus:
pip install smbus
Other Preparation Work
- Enable I2C7 on Rock 4SE:
Modify/boot/hw_intfc.confto setintfc:i2c7=on, then reboot.# Hardware Interface Config # For more details, check https://wiki.radxa.com/Rockpi4/hardware/devtree_overlays. # Set "on" to enable the optional hardware interfaces while set "off" to disable intfc:pwm0=off intfc:pwm1=off intfc:uart2=off intfc:uart4=off intfc:spi1=off intfc:spi2=off intfc:i2c2=off intfc:i2c6=off intfc:i2c7=on - install smbus
Command:'pip install smbus'
Sample Code
Use the Python example codes from the Raspberry Pi section (e.g., SetColor.py or Button.py).
Result
- Navigate to the Python examples directory:
cd DFRobot_RGB1602_RaspberryPi/python/examples - Run the program:
sudo python3 xxx.py(replacexxx.pywith the example file name). - The LCD will display output based on the program (e.g., color changes or button presses).
Additional Information
- Rock 4SE only supports Python code.
- Ensure I2C7 is enabled and all libraries are installed before running programs.
Was this article helpful?
