@@ -0,0 +1,836 @@
+#!/usr/bin/env python%0A%0Aimport serial%0Aimport struct %0Aimport time%0A%0A# Constants%0AOFFSET_TYPE = 6%0AOFFSET_ID = 1%0AOFFSET_DIRECTION = 0%0AOFFSET_MAGNITUDE = 0%0APACKET_DEVICE = 0b00%0APACKET_RELOAD = 0b01%0APACKET_SWAT = 0b10%0A%0Aspeeds = %7B%7D%0A%0Aport = serial.Serial(%22/dev/ttyACM0%22, baudrate=9600, timeout=3.0)%0A%0Adef updateSpeed(deviceid):%0A    packet = port.read(2)%0A    byte1, byte2 = map(int, packet)%0A%0Adef getSpeed(deviceid):%0A    return speeds%5Bmotorid%5D%0A%0Adef setSpeed(deviceid, speed=0, direction=0):%0A    byte1 = (PACKET_DEVICE %3C%3C OFFSET_TYPE) %7C (deviceid %3C%3C OFFSET_ID) %7C (direction %3C%3C OFFSET_DIRECTION)%0A    byte2 = (speed %3C%3C OFFSET_MAGNITUDE)%0A    packet = bytes(%5Bbyte1, byte2%5D)%0A    print packet%0A    print %5Bformat(int(p), '#010b') for p in packet%5B1:-1%5D.split(', ')%5D%0A    port.write(bytes(%5Bbyte1, byte2%5D))%0A%0Awhile True:%0A    setSpeed(1, 255, 0)%0A    time.sleep(1)%0A

add basic code to communicate with microcontroller from computer