What is the Raspberry Pi?
The Raspberry Pi is a small credit card sized computer that costs around £30. As it’s good value, quite powerful and ideal for coding clubs, one of the objectives of the GALLU project is to help coding clubs to program Raspberry Pi to move a simple robotic arm with Welsh speech commands.
Robotic Arm
This is Miss Deufys, a toy robotic arm. She only has 2 fingers but she can grip turn and drop things.
Here are the movements that Miss Deufys can perform:
light on grip open grip close wrist up wrist down elbow up elbow down shoulder up shoulder down turn to the right turn to the leftBefore the end of the project, Miss Deufys will answer to your Welsh speech commands. At the moment, Miss Deufys answers to a “Python” programme on the Raspberry Pi:
[code language=”python”]
# Program rheoli braich robot
# mewnforio’r llyfrgelloedd USB a Tie i Python
import usb.core, usb.util, time
#Rhoi enw “BraichRobot” i’r ddyfais USB
BraichRobot = usb.core.find(idVendor=0x1267,idProduct=0x0000)
#Gwirio a yw’r fraich wedi’i chysylltu
if BraichRobot is None:
raise ValueError(“Braich heb ei chysylltu”)
#Creu newidyn “Hyd”
Hyd=1
#Creu trefn i weithredu pob symudiad
def SymudBraich(Hyd, GorchBraich):
#Dechrau’r symudiadau
BraichRobot.ctrl_transfer(0x40,6,0×100,0,GorchBraich,1000)
#Stopio’r symudiadau ar ol cyfnod penodol
time.sleep(Hyd)
GorchBraich=[0,0,0]
BraichRobot.ctrl_transfer(0x40,6,0×100,0,GorchBraich,1000)
#Gorchmynion i’r robot
SymudBraich(1,[0,1,0]) #Troi i’r chwith
SymudBraich(1,[0,2,0]) #Troi i’r dde
SymudBraich(1,[64,0,0]) #Ysgwydd i fyny
SymudBraich(1,[128,0,0]) #Ysgwydd i lawr
SymudBraich(4,[16,0,0]) #Penelin i fyny
SymudBraich(4,[32,0,0]) #Penelin i lawr
SymudBraich(1,[4,0,0]) #Arddwrn i fyny
SymudBraich(1,[8,0,0]) #Arddwrn i lawr
SymudBraich(1,[2,0,0]) #Gafael agor
SymudBraich(1,[1,0,0]) #Gafael Cau
SymudBraich(1,[0,0,1]) #Golau ymlaen
[/code]