# Slope **Repository Path**: boolean_2/Slope ## Basic Information - **Project Name**: Slope - **Description**: 坡度 - **Primary Language**: C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-16 - **Last Updated**: 2026-06-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Based on the provided code map, I can see this is a vehicle slope detection system. Although I cannot directly access the source files, I have enough information from the code map to create a comprehensive README. --- # Slope - 车辆坡度检测系统 [查看中文说明](#english-version)] ## 项目简介 Slope 是一款基于 STM32F407 微控制器开发的车辆坡度检测系统。该系统通过 IMU(惯性测量单元)传感器采集车辆的加速度和陀螺仪数据,结合卡尔曼滤波算法实时计算道路坡度,并将结果通过 CAN 总线发送给车辆控制系统。 ## 硬件平台 - **MCU**: STM32F407ZETx (ARM Cortex-M4, 168MHz) - **IMU**: ASM330LHB (3轴加速度计 + 3轴陀螺仪) - **通信**: CAN 总线 - **调试**: USART1 (串口调试输出) ## 功能特性 - 实时采集加速度和陀螺仪原始数据 - 卡尔曼滤波算法处理传感器数据 - 上坡/下坡/平坦道路状态识别 - 道路坡度角度计算 - CAN 总线数据通信 - 参数 flash 存储保存 ## 项目结构 ``` Application/ ├── CODE/ │ ├── DRIVER/ # 底层驱动 │ │ ├── can_driver.c # CAN 驱动 │ │ ├── delay.c # 延时函数 │ │ ├── iic_driver.c # I2C 驱动 │ │ ├── led_driver.c # LED 驱动 │ │ ├── tim.c # 定时器 │ │ └── usart_driver.c # 串口驱动 │ ├── MAIN/ │ │ └── main.c # 主程序 │ └── SERVICE/ │ ├── ASM330LHB.c # IMU 传感器驱动 │ ├── flash_service.c # Flash 存储服务 │ └── SLOPE/ # 坡度检测算法 │ ├── slope_new.c │ ├── slope_new_data.c │ └── rt_nonfinite.c ├── PROJECT/ │ └── MDK/ # Keil 工程文件 └── STDLIB/ ├── CORE/ # STM32 核心文件 └── FWLIB/ # STM32 外设库 ``` ## 快速开始 ### 编译 使用 Keil MDK 打开 `Application/PROJECT/MDK/Application.uvprojx` 文件,编译即可。 ### 烧录 通过 J-Link 或 ST-Link 烧录 `Application/PROJECT/BIN/Application.bin` 到 MCU。 ### 调试 串口波特率默认 115200,观察调试信息输出。 ## CAN 通信协议 | CAN ID | 说明 | |-------|------| | 0x01 | 加速度计数据 | | 0x02 | 坡度与状态数据 | ## 依赖库 - STM32F4xx HAL Library - CMSIS --- ## English Version ### Project Overview Slope is a vehicle slope detection system based on STM32F407 microcontroller. It uses ASM330LHB IMU sensor to collect acceleration and gyroscope data, applies Kalman filter algorithm to calculate road slope in real-time, and transmits results via CAN bus to the vehicle control system. ### Hardware - **MCU**: STM32F407ZETx (ARM Cortex-M4, 168MHz) - **IMU**: ASM330LHB (3-axis accelerometer + 3-axis gyroscope) - **Communication**: CAN bus - **Debug**: USART1 ### Features - Real-time acceleration and gyroscope data acquisition - Kalman filter algorithm for sensor data processing - Uphill/Downhill/Flat road status detection - Road slope angle calculation - CAN bus data communication - Flash parameter storage ### Build Open `Application/PROJECT/MDK/Application.uvprojx` with Keil MDK and compile. --- ## 许可证 本项目仅供学习和研究使用。