MicroPython support for any motor controllers?

Hi, I'm planning to either use three ThunderBorg motor controllers (which I have been using for several years) or the PicoBorg Reverse for a Mars rover project.

I'd like to connect the motor controllers to an MCU running MicroPython rather than the Pi, so I was wondering if either the Python library for the ThunderBorg or PicoBorg Reverse has been ported to MicroPython. If not, I'd probably have to use a different board since I'm not sure I'd be up to porting it myself.

Thanks for any information.

piborg's picture

We do not have a premade library version of either the ThunderBorg or PicoBorg Reverse library, but it does not look like it would be too difficult to modify the existing libraries to work.

The main functions that would need to be changed are RawWrite, RawRead, Init and InitBusOnly - these all work with the standard Linux style I2C driver at the moment.

There may be some other bits that need a slight adjustment, but for the most part it should be a fairly straight forward set of changes to make.

Looking at the MicroPython website it seems like the provided I2C library is simple to use.

from machine import Pin, I2C

# creat an I2C bus
i2c = I2C(scl=Pin('X1'), sda=Pin('X2'))

# scan for list of attached devices
dev_list = i2c.scan()

# write to and read from a device
i2c.writeto(0x42, b'4')
data = i2c.readfrom(0x42, 4)

# memory transactions
i2c.writeto_mem(0x42, 0x12, b'')
data = i2c.readfrom_mem(0x42, 0x12, 2)

Example from https://micropython.org/

I would be happy to have a go at making the changes if that would help.

Subscribe to Comments for "MicroPython support for any motor controllers?"