Skip to content

qinhua/mpu6050-sensor-visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPU6050 传感与可视化

快速开始

Screen Orientation Detection(SOS)

基于 MPU6050 传感器的屏幕方向检测与可视化系统

SOS 演示


  • 安装依赖:

    • python3 -m venv venv && source venv/bin/activate
    • pip install -r screen-orientation-detection/requirements.txt
  • 运行后端服务:

    • python screen-orientation-detection/sos.py --sensor-face front(正面安装)
    • python screen-orientation-detection/sos.py --sensor-face back(背面安装)
  • 接口与端口:

    • WebSocket:ws://<ip>:18765
    • REST:GET http://<ip>:18766/api/orientationGET http://<ip>:18766/api/raw
  • 前端查看:

    • 直接打开 sos/index.html,查看实时角度、Pitch/Roll 与安装朝向标签
    • 页面支持“重连 WebSocket”按钮和横屏左右文案自适配

配置说明

  • 运行参数:

    • --sensor-face front|back 控制安装翻转(同步下发到前端为 sensorFaceFront
  • 代码内可调:

    • ORIENTATION_CORRECTIONscreen-orientation-detection/sos.py)用于整体角度校正(0/90/180/270)

目录结构(节选)

  • screen-orientation-detection/sos.py:后端(WebSocket + REST)与 MPU6050 读取
  • screen-orientation-detection/index.html:前端演示页面
  • screen-orientation-detection/requirements.txt:Python 依赖
  • .gitignore:忽略缓存、环境与生成文件

About

A repo for MPU6050 sensor data visualization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published