Having received a Pi2Go Lite for his birthday, my eldest son finished assembling it and wanted to move on to some software. He’s used Scratch at school so the intention is to use ScratchGPIO (thanks @cymplecy) to control it and get it following a line. There seems to be little documentation on using the Pi2Go with Scratch though.
I thought I’d get him started by providing an SD card with Raspbian installed and working. We then plugged it into the TV and booted, set the SSID (we’re using a Pi3) and connected to the WiFi. I then installed Tightvncserver so he could remote desktop into it. All good so far.
I thought I’d better check that the motors were doing something sensible so got hold of the 4tronix python library and examples (here). We then run motorTest.py but instead of getting motors working, we got an error:
IOError: [Errno 2] No such file or directory
A bit of googling seemed to indicate this was a problem with python-smbus library – this is the library that deals with I2C. I therefore tried installing the i2c-tools but it was already installed – frustrating!
There were numerous google results talking about using modprobe to check if drivers were loaded and info about adding drivers to /etc/modules etc but then fortunately I spotted a graphic showing I2C within the raspi-config panel.
Running “sudo raspi-config” and getting in to the advanced page allowed us to simply enable I2C. After rebooting, we run the motorTest.py script again and the motors came to life – success!
That’s the position so far – next job is to figure out how to control the motors from ScratchGPIO and also how to read the various sensors.
To be continued…