I am new to Raspberry Pi and it's communication. I need to make a project where I want to use a Raspberry pi 3 as a monitoring device for motors and battery system. The Raspberry pi itself communicates with Roboteq controller using USB connection. Below is the simple code I'm trying to send via USB to the motor controller. I want to get motor Amps and show values in the terminal:
import time import serial ser = serial.Serial( port = '/dev/ttyACM0', baudrate = 9600, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, bytesize = serial.EIGHTBITS, timeout = 1 ) print("connected to: " + ser.portstr) motor_AMPS = getvalue(_MOTAMPS) print(motor_AMPS)
In the Roboteq user manual was written that by using
getvalue(_MOTAMPS) command I can get motor amps. However when I am trying to run mention code the an error message is occur:
"module 'serial' has no attribute 'getvalue'" It seems that I'm sending data to controller wrongly. I'havent found much info about Raspberry pi and Roboteq controller communication. So any help is greatly appreciated.