mirror of
https://github.com/m5stack/m5-docs.git
synced 2026-05-20 10:23:01 -07:00
updated ANGLE
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 371 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -11,7 +11,7 @@
|
||||
|
||||
<mark>**M5Stick**</mark> is a mini esp32 development board including 1.3' OLED Screen(64x128), led, button, buzzer, IR Transmitter, 80mAh-Battery and **optional MEMS(MPU9250)**. Usually, you can put it on your wrist with `WATCH BELT` or band it on the wall with `WALL` or `BRICK`.
|
||||
|
||||
There are two version of it. White version does not contain MPU9250, gray version contains MPU9250 and some accessories(likes `WATCH BELT`, `WALL` and `BRICK`).
|
||||
There are two version of it. White version does not contain MPU9250, gray version contains MPU9250 and some accessories(likes `WATCH BELT`, `WALL/1515` and `BRICK`).
|
||||
|
||||
**The following figure shows the position indication of Button A and Assembly hole**
|
||||
|
||||
|
||||
+30
-13
@@ -8,13 +8,17 @@
|
||||
|
||||
## Description
|
||||
|
||||
<mark>ANGLE</mark> is a potentiometer sensor that can detect rotary
|
||||
angle.
|
||||
**<mark>ANGLE</mark>** is a Unit with the highest resistance of **10K** potentiometer. The potentiometer is a resistance element having three terminals and the resistance value can be adjusted by the knob rotation. Each time the potentiometer is rotated to a different position, the Unit outputs a different voltage value named Uo. It can be used to adjust motor speed, LED brightness and more. The specific analysis is shown in the figure below.
|
||||
|
||||
<img src="assets/img/product_pics/unit/angle/unit_angle_03.png">
|
||||
|
||||
The Unit's Grove interface is black, indicating an analog interface that needs to be connected to the M5Core's GROVE B interface.
|
||||
|
||||
## Feature
|
||||
|
||||
- GROVE interface, support [UIFlow](http://flow.m5stack.com) and [Arduino](http://www.arduino.cc)
|
||||
- Two Lego installation holes
|
||||
- Output voltage range: 0 ~ 2500mV
|
||||
- GROVE interface, support [UIFlow](http://flow.m5stack.com) and [Arduino](http://www.arduino.cc)
|
||||
- Two Lego installation holes
|
||||
|
||||
## Include
|
||||
|
||||
@@ -35,19 +39,32 @@ angle.
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
|
||||
// select the input pin for the potentiometer
|
||||
#define sensorPin 36
|
||||
|
||||
// declaration
|
||||
int sensorPin = 36;
|
||||
// last variable to store the value coming from the sensor
|
||||
int last_sensorValue = 0;
|
||||
// current variable to store the value coming from the sensor
|
||||
int cur_sensorValue = 0;
|
||||
|
||||
// initialization
|
||||
M5.begin();
|
||||
pinMode(sensorPin, INPUT);
|
||||
void setup() {
|
||||
M5.begin();
|
||||
pinMode(sensorPin, INPUT);
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.setCursor(0, 0);
|
||||
M5.Lcd.print("the value of ANGLE: ");
|
||||
}
|
||||
|
||||
// read data
|
||||
cur_sensorValue = analogRead(sensorPin);
|
||||
void loop() {
|
||||
// read the value from the sensor:
|
||||
cur_sensorValue = analogRead(sensorPin);
|
||||
M5.Lcd.setCursor(0, 25);
|
||||
if(abs(cur_sensorValue - last_sensorValue) > 10){//debaunce
|
||||
M5.Lcd.fillRect(0, 25, 100, 25, BLACK);
|
||||
M5.Lcd.print(cur_sensorValue);
|
||||
last_sensorValue = cur_sensorValue;
|
||||
}
|
||||
delay(50);
|
||||
}
|
||||
```
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/ANGLE/example_unit_angle_04.png">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<mark>**M5Stick**</mark> は1.3インチの白黒OLEDスクリーン(64x128)、LED、ボタン、ブザー、IR送信機と80mAhの電池を内蔵した開発用ボードです。小型なのでウェアラブルデバイスとして使用したり、壁などに固定して利用することが可能です。
|
||||
|
||||
**M5Stick** は2種類のモデルがあります。通常版と MPU9250 版です。MPU9250 版には9軸のIMUが搭載され、さらに`WATCH BELT`、`WALL`、`BRICK`が付属します。
|
||||
**M5Stick** は2種類のモデルがあります。通常版と MPU9250 版です。MPU9250 版には9軸のIMUが搭載され、さらに`WATCH BELT`、`WALL/1515`、`BRICK`が付属します。
|
||||
|
||||
**ボタンAとベルト用の凹部**
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<mark>**M5Stick**</mark> 是一个包含 1.3 寸 OLED 屏幕 ( 64x128 ),LED 灯,按键 A,蜂鸣器,红外发射管和 80mA 的电池的小型 ESP32 开发板。因为 M5Stick 两侧有安装孔,把手表底座安装到安装孔上之后,您可以将它戴在手腕上。
|
||||
|
||||
M5Stick有两个版本,白色外壳是无 MPU9250 的版本,灰色外壳是有 MPU9250 的版本,附送一些配件(`手表底座 ( WATCH BELT )`, `WALL` 和 `BRICK`)。
|
||||
M5Stick有两个版本,白色外壳是无 MPU9250 的版本,灰色外壳是有 MPU9250 的版本,附送一些配件(`手表底座 ( WATCH BELT )`, `WALL/1515` 和 `BRICK`)。
|
||||
|
||||
**下图为按键 A 和安装孔的位置指示**
|
||||
|
||||
|
||||
+32
-14
@@ -1,4 +1,4 @@
|
||||
# ANGLE - 角度传感器Unit {docsify-ignore-all}
|
||||
# Unit ANGLE {docsify-ignore-all}
|
||||
|
||||
<img src="assets/img/product_pics/unit/M5GO_Unit_angle.png" width="30%" height="30%"><img src="assets/img/product_pics/unit/unit_angle_grove_b.png" width="30%" height="30%">
|
||||
|
||||
@@ -8,12 +8,17 @@
|
||||
|
||||
## 描述
|
||||
|
||||
**<mark>ANGLE</mark>** 是一个电位器 Unit,通过这个 Unit 可以检测手动旋转的角度。
|
||||
**<mark>ANGLE</mark>** 是一个含有最高电阻为 **10K** 电位器的 Unit。电位器是具有三个引出端、阻值可由旋钮旋转调节的电阻元件。每次旋转电位器到不同位置,Unit 会输出不同的电压值 Uo。它可以被用来调整电机转速,LED 灯亮度等。具体分析如下图所示。
|
||||
|
||||
<img src="assets/img/product_pics/unit/angle/unit_angle_03.png">
|
||||
|
||||
该 Unit 的 Grove 接口是黑色,说明是模拟接口,需要连接到 M5Core 的 GROVE B 接口。
|
||||
|
||||
## 特性
|
||||
|
||||
- GROVE接口,支持[UIFlow](http://flow.m5stack.com)编程,[Arduino](http://www.arduino.cc)编程
|
||||
- Unit内置两个Lego插件孔,方便与Lego件结合
|
||||
- 输出电压范围:0 ~ 2500mV
|
||||
- GROVE 接口,支持 [UIFlow](http://flow.m5stack.com) 编程,[Arduino](http://www.arduino.cc )编程
|
||||
- Unit 内置两个 Lego 插件孔,方便与 Lego 件结合
|
||||
|
||||
## 包含
|
||||
|
||||
@@ -34,19 +39,32 @@
|
||||
|
||||
```arduino
|
||||
#include <M5Stack.h>
|
||||
|
||||
// select the input pin for the potentiometer
|
||||
#define sensorPin 36
|
||||
|
||||
// declaration
|
||||
int sensorPin = 36;
|
||||
// last variable to store the value coming from the sensor
|
||||
int last_sensorValue = 0;
|
||||
// current variable to store the value coming from the sensor
|
||||
int cur_sensorValue = 0;
|
||||
|
||||
// initialization
|
||||
M5.begin();
|
||||
pinMode(sensorPin, INPUT);
|
||||
void setup() {
|
||||
M5.begin();
|
||||
pinMode(sensorPin, INPUT);
|
||||
M5.Lcd.setTextSize(2);
|
||||
M5.Lcd.setCursor(0, 0);
|
||||
M5.Lcd.print("the value of ANGLE: ");
|
||||
}
|
||||
|
||||
// read data
|
||||
cur_sensorValue = analogRead(sensorPin);
|
||||
void loop() {
|
||||
// read the value from the sensor:
|
||||
cur_sensorValue = analogRead(sensorPin);
|
||||
M5.Lcd.setCursor(0, 25);
|
||||
if(abs(cur_sensorValue - last_sensorValue) > 10){//debaunce
|
||||
M5.Lcd.fillRect(0, 25, 100, 25, BLACK);
|
||||
M5.Lcd.print(cur_sensorValue);
|
||||
last_sensorValue = cur_sensorValue;
|
||||
}
|
||||
delay(50);
|
||||
}
|
||||
```
|
||||
|
||||
<img src="assets/img/product_pics/unit/unit_example/ANGLE/example_unit_angle_04.png">
|
||||
@@ -65,5 +83,5 @@ cur_sensorValue = analogRead(sensorPin);
|
||||
|
||||
<table>
|
||||
<tr><td>M5Core(GROVE B)</td><td>GPIO36</td><td>GPIO26</td><td>5V</td><td>GND</td></tr>
|
||||
<tr><td>角度传感器Unit</td><td>传感器引脚</td><td> </td><td>5V</td><td>GND</td></tr>
|
||||
<tr><td>角度传感器 Unit</td><td>传感器引脚</td><td> </td><td>5V</td><td>GND</td></tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user