#!/usr/bin/env python

import usb
import sys
import random
import time

sys.path.append("..")
from arduino.usbdevice import ArduinoUsbDevice

if __name__ == "__main__":
    digispark = ArduinoUsbDevice(idVendor=0x16c0, idProduct=0x05df)

    while 1:
        digispark.write(ord("s"))
        digispark.write(random.randint(0,255))
        digispark.write(random.randint(0,255))
        digispark.write(random.randint(0,255))
        digispark.write(ord("e"))
        # time.sleep(2)