Wednesday, 17 April 2013

Digispark / Rpi.

Talking with a relative about the arduino / Pi integration, he gave me a 'digispark' which he'd backed on kickstarter.  This device should be able to plug into the USB, and tidy up the wiring a bit from the arduino idea to measure distance........   So, how to make it work.

I don't seem able to program this on Linux - it isn't recognised on my PC - USB problems, however I can program it on Windows, then plug into the Pi, and it is recognised.  (There need to be various bits for the Pi recompiled to make the IDE work on Pi, and this is outside my needs (capabilities probably....).

On the pi...  sudo pip install PyUSB

From the digispark wiki, install the examples, load up the DigiUSB example onto the digispark, and run the on the Pi:-

pi@raspberrypi ~/digispark/DigisparkExamplePrograms-master/Python/DigiUSB/source $ cat

# Written for PyUSB 1.0 (w/libusb 1.0.3)

import usb # 1.0 not 0.4

import sys

from arduino.usbdevice import ArduinoUsbDevice

if __name__ == "__main__":
        theDevice = ArduinoUsbDevice(idVendor=0x16c0, idProduct=0x05df)
        sys.exit("No DigiUSB Device Found")

    import sys
    import time

    while 1 == 1:
            lastChar = chr(
            if(lastChar == "\n"):

            # TODO: Check for exception properly

Cool. - Something was received!!  The foundation to rework the distance measurement here.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.