Advertisement
silver2row

Might be something...

May 8th, 2020
1,690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. def software_reset(i2c=None, **kwargs):
  2.     """Sends a software reset (SWRST) command to all servo drivers on the bus."""
  3.     # Setup I2C interface for device 0x00 to talk to all of them.
  4.     if i2c is None:
  5.         from smbus2 import SMBus
  6.         i2c = SMBus
  7.     self._device = i2c.open(0x00, bus="/dev/i2c-2", **kwargs)
  8.     self._device.write_byte(0x06)  # SWRST
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement