Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:applications:gsensor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
products:sbc:common:applications:gsensor [2026/02/03 22:53]
gray update by using AI
products:sbc:common:applications:gsensor [2026/02/23 21:16] (current)
gray old revision restored (2025/02/18 01:40)
Line 3: Line 3:
 ===== Introduction ===== ===== Introduction =====
  
-This guide explains how to identify the G-Sensor device node and read acceleration data from it using a C program.+By referring to this page, you will know which node of G-Sensor is, and how to read the value of G-Sensor through C program.
  
 ===== System Configuration ===== ===== System Configuration =====
  
-Verify the G-Sensor device node exists:+Check G-sensor node.
  
 ```shell ```shell
 $ ll /dev/accel  $ ll /dev/accel 
-``` 
-Expected output: 
-```shell 
 crw-rw-rw- 1 root root 10, 50 Mar 18 12:17 /dev/accel crw-rw-rw- 1 root root 10, 50 Mar 18 12:17 /dev/accel
 ``` ```
Line 19: Line 16:
 ===== Demo Source Code ===== ===== Demo Source Code =====
  
-The following sample program demonstrates reading data from the G-Sensor using default settings. You can extend it to implement other functions.+The source code only realizes the use of default settings to read data, for other functions, you can implement them by yourself.
  
 ```c gsensor_sample_data.c ```c gsensor_sample_data.c
Line 86: Line 83:
 ``` ```
  
-Compile the program:+Compile the source code obtained.
  
 ```shell ```shell
Line 94: Line 91:
 ===== Demonstrate ===== ===== Demonstrate =====
  
-Run the compiled program. While it is running, tilt or move the board to observe changes in the acceleration values.+Rotate the board while running, you can see the changes in G-Sensor data.
  
 ```shell ```shell
Last modified: 2026/02/03 22:53 by gray