• Home
Name Date Size #Lines LOC

..--

entry/12-May-2024-549500

screenshots/device/12-May-2024-

.gitignoreD12-May-2024121 88

README.mdD12-May-2024512 168

README_zh.mdD12-May-2024828 2915

build-profile.json5D12-May-20241 KiB4341

hvigorfile.jsD12-May-2024174 21

package.jsonD12-May-2024394 2019

README.md

1# Device Management - Sensor
2
3### Introduction
4
5This sample uses the orientation sensor APIs to implement the compass effect.
6
7### Usage
8
9When you rotate your device, the compass pointer rotates with it. The rotation angle for true north is displayed in the lower part of the home screen of the sample app.
10
11### Constraints
12
13After opening the sample app, you need to make a figure 8 until the compass is calibrated.
14
15This sample can only be run on standard-system devices. (Currently, only wagner is supported.)
16

README_zh.md

1# 传感器
2
3### 简介
4
5本示例采用了传感器接口中的方向传感器,实现了指南针的效果。实现效果如下:
6
7![](./screenshots/device/sensor.png)
8
9### 相关概念
10
11方向传感器:订阅方向传感器,返回设备围绕X、Y、Z轴三个方向的旋转角度。
12
13### 相关权限
14
15控制马达振动权限:ohos.permission.VIBRATE
16
17### 使用说明
18
19转动设备,指针跟随转动,转动的角度为偏离正北方的角度,并在界面下方显示。
20
21### 约束与限制
22
231.打开应用后需要对传感器进行画8校准。
24
252.本示例仅支持在标准系统上运行。
26
273.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。
28
294.本示例需要特殊模块与特定传感器,目前该功能仅支持部分机型。