Sunday, 8 April 2018

Experiments with GPIOTriggers / switches)



Using gpio triggers / switches 3 demos.

All of these three demos use GPIO PIN 3 as a trigger.

Demo 1 / Scalable housing

This code will allow you to use gpio PIN 3 and GND with two male to female jumper cables attached as a switch / or trigger for an event in Minecraft. This example triggers an question to ask you how many houses you would like in a row/ street. After typing this in you it then renders the "street" in your Minecraft world. Which needs to be open before you execute the code or else it will give an error.


What you will need:
  • Two female to male jumper cables
  • Raspberry Pi
  • Minecraft Pi installed the code from below
You can see below an example street of 7 houses:


Code

You can download the code from here




Demo 3: Storm Trooper and Rainbow Walls

This is 32block x 32 block grid animation. Coding wise its not as efficient as demo 2 but creates some nice effects. You can see what it does by clicking on the link to the video below.

You can see the event working here:

link


Code

link




Demo 2: Pixel Cakes

This is a simplified version of the RPI pixelcakes activity which works with Micro:bit. You can see what it does by clicking on the link to the video below.

You can see the event working here:

link

Code

link




Enjoy,


Chris

No comments:

Post a Comment