Skip to content

Using the Motor Class

Benjamin Bussell edited this page Sep 16, 2019 · 2 revisions

Init

The initialization of a Motor object requires a serial connection to be passed as a parameter. The required baud rate is 11520

import Motor

motor_Object = Motor(serial.Serial('COM3', 11520, timeout=0.1)

Run

The class works by opening up a side thread that is constantly sending the defined current to the FSESC. To open this thread call the method .run()

import Motor

motor_Object = Motor(serial.Serial('COM3', 11520, timeout=0.1)
motor_Object.run()

If necessary the method can return the thread where you can then perform thread operations, maybe not sure how this would work without having called the threading library.

Exit

This class stops the thread from looping

Tools Needed

  • Elegoo Nano
  • FSESC 4.12
  • VESC-Tool
  • PyCharm
  • Logitech GamePad
  • 3 Jumper Cables
  • The Car
  • Jetson TX1
  • The Cars VESC

Clone this wiki locally