OP180 Unit

以下产品受支持:

OP180

MicroPython 应用示例:

import os, sys, io
import M5
from M5 import *
import time
from unit import *

op180_0 = None

def setup():
global op180_0

op180_0 = OPUnit((8, 9), type=1)
M5.begin()
Widgets.fillScreen(0x222222)

print(op180_0.get_value)
time.sleep(1)
print(op180_0.count_value)
time.sleep(1)
op180_0.count_reset()
time.sleep(1)

UiFlow2 应用示例

example.png

op180_core_example.m5f2

class OPUnit

Constructors

class OP180(io)

创建一个 OP180 对象。

参数为:
  • io 是检测引脚。

UiFlow2

init.png

Methods

OP180.count_value()

获取计数值。

UiFlow2

get_count_value.png

OP108.count_reset()

重置仪表值。

UiFlow2

reset_count_value.png