OP180 Unit

The following products are supported:

OP180

Micropython Example:

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:

example.svg

op180_core_example.m5f2

class OPUnit

Constructors

class OP180(io)

Create an OP180 object.

The parameters is:
  • io is the detection pin.

UIFLOW2:

init.svg

Methods

OP180.count_value()

Get the count value.

UIFLOW2:

get_count_value.svg

OP108.count_reset()

Reset the meter value.

UIFLOW2:

reset_count_value.svg