Jumbo Servo Code, Woodwork and Talk
This week saw some more progress on the jumbo servo.
Code
After looking at some other people’s code, the read register logic was changed slightly. For a read command rather than 3 bytes being sent just a single byte is sent representing the read register. The reason for this change is that the libraries on the Pi that I’m using to control the servo combine the read into a single command which sends out the read register as a single byte then reads back the result. So changing this makes my interaction with the servo more standard.
Here’s how an example for moving the servo to 45 degrees might look in Python.
bus = smbus.SMBus(1)
slaveAddress = 8
isRunning = 1
angle = 45
bus.write_byte_data(slaveAddress , 2, angle )
while bus.read_word_data (slaveAddress, isRunning) != 0:
time.sleep(0.1)
Woodwork
I’ve also been finishing off the case for the servo, adding detailing, a horn and a coat or two of primer.
Talk
Brian from Linuxing in London invite me to give a talk on the Google Vision kit I’ve been experimenting with. The talk should be appearing on the skill matter site in the next few days.