This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:applications:gsensor [2022/07/04 21:27] frank Add Gsensor |
products:sbc:common:applications:gsensor [2025/02/18 01:40] (current) nick |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | This document mainly introduces Gsensor. You will know which node of Gsensor | + | By referring to this page, you will know which node of G-Sensor |
| ===== System Configuration ===== | ===== System Configuration ===== | ||
| - | Check Gsensor | + | Check G-sensor |
| - | ```sh | + | ```shell |
| $ ll / | $ ll / | ||
| 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 | + | The source code only realizes the use of default settings to read data, for other functions, you can implement |
| ```c gsensor_sample_data.c | ```c gsensor_sample_data.c | ||
| Line 83: | Line 83: | ||
| ``` | ``` | ||
| - | Compile | + | Compile |
| - | ```sh | + | ```shell |
| $ gcc -o gsensor_sample_demo gsensor_sample_demo.c | $ gcc -o gsensor_sample_demo gsensor_sample_demo.c | ||
| ``` | ``` | ||
| Line 91: | Line 91: | ||
| ===== Demonstrate ===== | ===== Demonstrate ===== | ||
| - | Rotate the board while running, you can see the changes in gsensor | + | Rotate the board while running, you can see the changes in G-Sensor |
| - | ```sh | + | ```shell |
| - | $ ./ | + | $ sudo ./ |
| gsensor node open success!!! | gsensor node open success!!! | ||
| gsensor start sueecss !!! | gsensor start sueecss !!! | ||