pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Reflective IR

Example

from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
reflective_ir_0 = unit.get(unit.REFLECTIVE_IR, unit.PORTB)

while True:
  print((str('analog:') + str((reflective_ir_0.get_analog_output()))))
  print((str('digital:') + str((reflective_ir_0.get_digital_output()))))
  wait_ms(2)

API

print(reflective_ir_0.get_analog_output())
  • Reads the ADC value of the reflected IR unit and returns an integer value
print(reflective_ir_0.get_digital_output())
  • Reads the numeric value of the reflected IR unit and returns an integer value
On This Page