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
Next revision
Previous revision
products:sbc:common:applications:gsensor [2022/08/07 22:51]
olivia [Introduction]
products:sbc:common:applications:gsensor [2026/02/03 22:53] (current)
gray update by using AI
Line 3: Line 3:
 ===== Introduction ===== ===== Introduction =====
  
-This page introduces G-Sensor. You will know which node of G-Sensor is, and how to read the value of G-Sensor through C program.+This guide explains how to identify the G-Sensor device node and read acceleration data from it using a C program.
  
 ===== System Configuration ===== ===== System Configuration =====
  
-Check G-sensor node.+Verify the G-Sensor device node exists:
  
 ```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 16: Line 19:
 ===== Demo Source Code ===== ===== Demo Source Code =====
  
-The source code only realizes the use of default settings to read data, for other functions, you can implement them by yourself.+The following sample program demonstrates reading data from the G-Sensor using default settings. You can extend it to implement other functions.
  
 ```c gsensor_sample_data.c ```c gsensor_sample_data.c
Line 83: Line 86:
 ``` ```
  
-Compile the source code obtained.+Compile the program:
  
 ```shell ```shell
Line 91: Line 94:
 ===== Demonstrate ===== ===== Demonstrate =====
  
-Rotate the board while running, you can see the changes in G-Sensor data.+Run the compiled program. While it is running, tilt or move the board to observe changes in the acceleration values.
  
 ```shell ```shell
-$ ./gsensor_sample_demo+sudo ./gsensor_sample_demo
 gsensor node open success!!! gsensor node open success!!!
 gsensor start sueecss !!! gsensor start sueecss !!!
Last modified: 2022/08/07 22:51 by olivia