pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Atomic H-Driver

Example

from m5stack import *
from m5ui import *
from uiflow import *
from base.HDriver import HDriver
import time

hdriver = HDriver()
print((str('Input Voltage: ') + str((hdriver.get_voltage()))))
while True:
  print((str('Motor Fault Status: ') + str((hdriver.get_status()))))
  hdriver.set_speed(100)
  wait(1)
  hdriver.set_speed(0)
  wait(1)
  hdriver.set_speed(-100)
  wait(1)
  hdriver.set_speed(0)
  wait(1)
  wait_ms(2)

API

from base.HDriver import HDriver
hdriver = HDriver()
  • Initialize Atomic H-Driver.
hdriver.get_status()
  • Get the current operating status:
    • 0: Fault
    • 1: OK
hdriver.get_voltage()
  • Read the input voltage value (V).
hdriver.set_speed(100)
  • Control motor speed:
    • Input range: -100 to +100, with 0 to stop.
On This Page