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/08/07 21:44] olivia [Demo Source Code] |
products:sbc:common:applications:gsensor [2026/02/03 22:53] (current) gray update by using AI |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | This pqge mainly introduces | + | This guide explains how to identify the G-Sensor |
| ===== System Configuration ===== | ===== System Configuration ===== | ||
| - | Check Gsensor | + | Verify the G-Sensor device |
| ```shell | ```shell | ||
| $ ll / | $ ll / | ||
| + | ``` | ||
| + | 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 following sample program demonstrates reading data from the G-Sensor using default settings. You can extend it to implement |
| ```c gsensor_sample_data.c | ```c gsensor_sample_data.c | ||
| Line 83: | Line 86: | ||
| ``` | ``` | ||
| - | Compile | + | Compile |
| ```shell | ```shell | ||
| Line 91: | Line 94: | ||
| ===== Demonstrate ===== | ===== Demonstrate ===== | ||
| - | Rotate | + | Run the compiled program. While it is running, |
| ```shell | ```shell | ||
| - | $ ./ | + | $ sudo ./ |
| gsensor node open success!!! | gsensor node open success!!! | ||
| gsensor start sueecss !!! | gsensor start sueecss !!! | ||