Skip to main content

Posts

Showing posts with the label picademy

Daleks, cameras, and a mutant rabbit.

A little more detail on my experience of PiCademy and some of the code developed (and I apologies it is not well developed). Programming LEDs and Motors through either the the GPIO or using an HAT (see the images below) is just what I enjoy the most. To have a go, you may have to have the following: The latest version of Raspbian, at the time of writing Jessie ( https://www.raspberrypi.org/downloads/raspbian/ ) Import the following sudo apt-get install python-twython sudo pip3 install explorehat sudo pip3 install gpiozero In the above image was my attempt at a simple 'Dalek' - essentially a cup and straw, with a wheeled motor inside. Controlled using python,  Pi through an Explorer HAT PRO . It essentially moved in a circle either clockwise (button 1 on the explorehat) or anti-clockwise (button 2). import explorerhat from time import sleep from random import randint def wheel(channel, event):     duration = randint(1,2) ...