Skip to main content

Posts

Raspberry Pi gesture controlled Minecraft X-Wing (revisited)

figure 1 This post builds on two earlier posts and tries to address some of the very useful comments from people who have tried this. I hope this helps. Overall the project builds on an earlier project to get a simple X-Wing into Minecraft on a Raspberry Pi.  The goal was get Python to build and move the X-Wing. Details of this project can be found  here . Main revision: In this project and the earlier one is based around Python 3 running the Raspbian 'Jessie' November version OS. Also additional libraries may need to be add to get the minecraftstuff (such as ShapeBlock() and MinecraftShape() ). Details on how to obtain and install these can be found at    http://www.stuffaboutcode.com/2013/11/codin g-shapes-in-minecraft.html  . In this post the additional of Pirmoroni's  Skywriter is included to allow movements of a hand or a finger to enable the X-Wing to take-off, land, move forward or backward. It builds on ideas from the book  Adv...

Raspberry Pi - Python Junkbot

Junkbots ( http://junkbots.blogspot.co.uk/ ) are based around using  materials such as drink's cans, broken propellors and motors to produce something that moves by vibration. Previous designs be found at: Raspberry Pi Controlled Junkbots Junkbots blog The latest tweak to the Raspberry Pi based Junkbot design is to use the combination of Python and Pimoroni's Explorer HAT PRO to control it. Explorer HAT Pro is a good choice, it can control two motors with a library provided to simplify the programming. For this the Junkbot was the one shown above: a drinks can, pen, LEGO bits, motor and broken propellor. Before the Explorer HAT can be used the library needs to be installed via the Terminal and the instructions below curl get.pimoroni.com/explorerhat | bash Python code to control the junkbot is shown below. import explorerhat from time import sleep def spin1(duration):     explorerhat.motor.one.forward(100)     sleep(duration)...

Robots behaving...

Reblogged from:  http://scott-ltattempts.blogspot.co.uk/2011/05/robot-behaviours.html Behaviour based robots was used in the teaching as way of getting the students to think out AI a little deeper and in particular  Do we need Human Level intelligence ? or rather  Do we  always  need to aim for Human Level Intelligence? Lego Mindstorms robot are a good vehicle for students to start trying out idea around behaviour-based robotics. They are inexpensive, programmable and with the  LeJOS  software installed on them; have behaviours built into the programming which is done in Java. A good example to use comes from Bagnall's book (B Bagnall (2002) Core Lego Mindstorms:  Programming the RCX in Java , ISBN:  978-0130093646) code 1: HitWall //Taken from Bagnall (2002) import josx.robotics.*; import josx.platform.rcx.*; public class HitWall implements Behavior { public boolean takeControl() { return Sensor.S2.readBooleanVal...

Raspberry Pi gesture controlled Minecraft X-Wing

figure 1 This post builds on an earlier project to get a simple X-Wing into Minecraft on a Raspberry Pi.  The goal was get Python to build and move the X-Wing. Details of this project can be found here . In this post the additional of Pirmoroni's Skywriter HAT included to allow movements of a hand to enable the X-Wing to take-off, land, move forward or backward. It builds on ideas from the book Adventures in Minecraft on using Python and Minecraft using a Raspberry Pi. figure 2 The  Skywriter  is a Raspberry Pi HAT (see figure 2) that allows positional information of the hand just above the board. In this project it is detecting flicks of the hand up, down, or across the board to determine the direction of motion. Before you start, to use the Skywriter, in the terminal you need to add  curl -sSL get.pimoroni.com/skywriter | bash To start with we just placed the X-Wing above the player by placing blocks in the shape (roughly) of the X-Wing bas...

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) ...

BB-8, Droid I was looking for... - Tynkering

In a recent post controlling the Sphero BB-8 with the Tickle App was discussed. This is not the only alternative software, the Tynker App can also control it. This is also a graphical drag and drop programming tool, that you can connect certain 'toys' to. Though the App itself is about developing programming skills. The Sphero BB-8 Droid can be connected to Tynker (or how I did it anyway) by: Clicking on the Create button on the opening screen; Clicking on Blank Template; Deleting the 'Actor' that has there and clicking on the + button in the top right hand corner of the screen; Clicking on connected toys and selecting the grey ball; On the main screen it should say spherobot with a code button at the side, click on the button; You should get a screen with some code for changing the colour shown and then moving in a square- you can change this for your own code. Not all the commands, listed down the side, will work with the BB-8 - I re...

BB-8, this is the Droid I was looking for...

Previously I have shown the Sphero BB-8 rolling around the room under its own control .  One of the features of the Sphero BB-8 Droid  is it programmable either by its own downloadable software but also by one of my favourite apps - TickleApp  which has been discussed in previous posts. This app allows control of a quite an impressive range of devices using the same interface. Examples, some of which have been discussed previously (e.g Parrot Minidrone  or Dash and Dot ), are shown below.  The App uses an graphical programming interface similar to Scratch or Blockly  to produce code. The example here it a very simple one of: Spin twice for one second; Move roughly in a square; If the BB-8 collides (or is bumped) it is set to spin twice for a second.   Ok, not the most sophisticated bit of coding; but it ...