pixels-rs
is a Rust project that demonstrates the use of an embedded graphics library to render an interactive 3D cube on an RM67162 AMOLED display with touch input capabilities. The project is designed to run on an ESP32-S3 microcontroller.
- Interactive 3D cube with touch-based rotation control
- Quaternion-based rotation for smooth animation
- Touch gesture recognition for cube manipulation
- Real-time FPS display
- Configurable display parameters
- Support for CST816S touch controller
main.rs
: Main application entry point, handling display, touch input, and 3D renderingdisplay.rs
: Display abstraction layer and graphics primitivesconfig.rs
: Configuration constants for display dimensions
- ESP32-S3 microcontroller
- RM67162 AMOLED display
- CST816S touch controller
- I2C and SPI interfaces
s3-display-amoled-touch-drivers
: Display and touch controller driversembedded-graphics
: 2D graphics library for embedded systemsmicromath
: Mathematical operations including quaternion supportesp-hal
: ESP32-S3 hardware abstraction layerembassy-executor
: Async runtime for embedded systemsembedded-hal-bus
: Hardware abstraction for I2C/SPI communication
-
Clone the repository:
git clone https://github.com/yourusername/pixels-rs.git cd pixels-rs
-
Build the project:
cargo build --release
The cube can be manipulated in two ways:
- Automatic rotation around the Y-axis
- Touch interaction:
- Touch and drag to rotate the cube
- The rotation angle is proportional to the drag distance
Display dimensions in config.rs
:
pub const DISPLAY_HEIGHT: u16 = 240;
pub const DISPLAY_WIDTH: u16 = 536;
This project is licensed under the MIT License. See the LICENSE file for details.