https://github.com/littleguest/xiaofang
"小方"复刻,使用Rust编写,运行在esp32c3上,采用ws2812显示,集成沙漏、骰子、卦象、贪吃蛇、迷宫等游戏
https://github.com/littleguest/xiaofang
bagua esp32 maze rust snake sokoban timers ws2812
Last synced: about 1 month ago
JSON representation
"小方"复刻,使用Rust编写,运行在esp32c3上,采用ws2812显示,集成沙漏、骰子、卦象、贪吃蛇、迷宫等游戏
- Host: GitHub
- URL: https://github.com/littleguest/xiaofang
- Owner: LittleGuest
- License: mit
- Created: 2023-10-04T14:42:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T14:17:58.000Z (11 months ago)
- Last Synced: 2025-04-07T04:15:29.470Z (6 months ago)
- Topics: bagua, esp32, maze, rust, snake, sokoban, timers, ws2812
- Language: Rust
- Homepage:
- Size: 17.4 MB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 原创作品
[复古像素风 桌面电子沙漏,Arduino(atmega328p+mpu6050)](https://www.bilibili.com/video/BV1QP411Y7K3/?share_source=copy_web&vd_source=41da856c543dfcc8802471a83af59251)
## 复刻
"小方"复刻,使用 Rust 编写,运行在 esp32c3 上,采用 ws2812 显示,集成沙漏、骰子、卦象、贪吃蛇、迷宫等游戏
## 单机游戏
- [x] 沙漏
- [x] 骰子
- [x] 卦象
- [x] 贪吃蛇
- [x] 迷宫
- [ ] 是方块人就下一百层
- [x] 推箱子
- [ ] 躲避方块
- [ ] ...## 联机游戏
- [ ] 对打球
- [ ] ...## 接线
### MPU6050
| MPU6050 | MCU | |
| ------- | ----- | ------- |
| VCC | 3.3V | |
| GND | GND | |
| SCL | GPIO5 | I2C_SCL |
| SDA | GPIO4 | I2C_SDA |### 无缘蜂鸣器
| 陶瓷片无缘蜂鸣器 | MCU |
| ---------------- | ------ |
| V+ | GPIO11 |
| V- | GND |### WS2812
| WS2812 | MCU | |
| ------ | ----- | -------- |
| IN | GPIO3 | SPI_MOSI |
| V+ | 3.3V | |
| V- | GND | |### 麦克风
| - | MCU | |
| --- | ----- | ---- |
| A0 | GPIO0 | ADC0 |
| V+ | 5V | |
| GND | GND | |
| D0 | - | |## wokwi仿真
```bash
cargo install wokwi-servercargo b -r
wokwi-server --chip esp32c3 --id 413175440833513473 target/riscv32imc-unknown-none-elf/release/cube
```## 三方库
## 硬件相关
第一次设计画PCB,暂时不知道有啥问题,未验证。
## 参考链接
- https://blog.theembeddedrustacean.com/esp32-embedded-rust-at-the-hal-pwm-buzzer