Hello,
I am trying to get a Roller485 to work with a POWRCAN module attached to a CORE controller but I don't seem to get it to run.
Please note that it does work over I2C.
Here's the configuration:
POWERCAN:
12V, line A to line A, line B to line B, TX:G17, RX:G16, terminator enabled.
Roller485:
RS485, node #:1, 115200 Baud, MODE: Speed
I am attaching the UIFlow2 application.
Thank you for your support.
import os, sys, io
import M5
from M5 import *
from module import PwrCANModuleRS485
from unit import Roller485Unit
label0 = None
pwrcan_0 = None
roller485_0 = None
def setup():
global label0, pwrcan_0, roller485_0
M5.begin()
Widgets.setRotation(1)
Widgets.fillScreen(0x222222)
label0 = Widgets.Label("label0", 38, 38, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)
pwrcan_0 = PwrCANModuleRS485(2, baudrate=115200, bits=8, parity=None, stop=1, tx=17, rx=16)
roller485_0 = Roller485Unit(pwrcan_0, address=1, mode=Roller485Unit.RS485_MODE)
def loop():
global label0, pwrcan_0, roller485_0
label0.setText(str('Label'))
roller485_0.set_motor_mode(1)
roller485_0.set_motor_speed(100)
roller485_0.set_speed_max_current(100)
if __name__ == '__main__':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")
