Welcome to MSPM0 Smart Robot Car repository
1.K210 autonomous driving
K210 Autonomous Driving
K210 Autonomous Driving1. Hardware Connection2. Code Analysis3. Main Functions4. K210 Program Burning5. Experimental Phenomena
1. Hardware Connection
| K210 Vision Module | MSPM0G3507 |
|---|---|
| 5V | 5V |
| GND | GND |
| RX | TX2 |
| TX | RX2 |
Physical Connection Diagram

Schematic Diagram



K210 Protocol
| Experiment Routine | Start Symbol | Length | Routine Number | Routine Group | Data Amount | x | Separator | y | Separator | w | Separator | h | Separator | Checksum | End Symbol |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Color Recognition | $ | XX | 01 | BB | 04 | XXX | , | XXX | , | XXX | , | XXX | , | XX | # |
Control Flow Chart
2. Code Analysis
bsp_k210_use.c
xxxxxxxxxx// 解析接收的完整消息 / Parse received complete messagevoid deal_recvmsg(void){ ... if(r_index!=buf_len) { buf_len = 0; return ; } // 提取有效数据(过滤逗号) / Extract valid data (filter commas) for(index = 0 ;index<number;index++) { if(buf_msg[4+index] == 0x2c && i_duo ==0) { i_duo = 1; continue; } data[data_i++]=buf_msg[4+index];