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/07/06 23:42]
frank replease Gsensor to G-Sensor
products:sbc:common:applications:gsensor [2022/08/07 22:51] (current)
olivia [Introduction]
Line 3: Line 3:
 ===== Introduction ===== ===== Introduction =====
  
-This document mainly introduces G-Sensor. You will know which node of G-Sensor is, and how to read the value of G-Sensor through 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 =====
  
-Check Gsensor node.+Check G-sensor node.
  
-```sh+```shell
 $ ll /dev/accel  $ ll /dev/accel 
 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 16:
 ===== Demo Source Code ===== ===== Demo Source Code =====
  
-The source code only realizes the use of default settings to read data, other functions users can implement by yourself.+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 83: Line 83:
 ``` ```
  
-Compile+Compile the source code obtained.
  
-```sh+```shell
 $ gcc -o gsensor_sample_demo gsensor_sample_demo.c $ gcc -o gsensor_sample_demo gsensor_sample_demo.c
 ``` ```
Line 93: Line 93:
 Rotate the board while running, you can see the changes in G-Sensor data. Rotate the board while running, you can see the changes in G-Sensor data.
  
-```sh+```shell
 $ ./gsensor_sample_demo $ ./gsensor_sample_demo
 gsensor node open success!!! gsensor node open success!!!
Last modified: 2022/07/06 23:42 by frank