Skip to main content

Posts

Build a Disco cube:bit that reacts to music.

In a previous post Micro:bit and Cube:bit 'says' Hello  I introduced the start of me playing with the  4tronix Cube:bit . One of the things I want to try is get the cube to react to music, based around the accelerometers in a micro:bit picking up vibrations.  Luckily, in an earlier post, I had done something similar for the  Proto-Pic Micro:pixel  (see  Dancing Pixels  for more details).  Essentially the idea is  the vibrations from the music shake the micro:bit enough to give measurable changes in three axis, and these values are used to change the pixel's colour - in fact five pixels at a time. The code shown below is all that was needed: from microbit import * import neopixel, random np = neopixel.NeoPixel(pin0, 125) while True:     for pxl in range (2,125, 5):         rd=int(abs(accelerometer.get_x())/20)         gr=int(abs(accelerometer.get_y())/20)   ...

Microbit and Cube:bit 'says' Hello

Since seeing pictures of the 4tronix Cube:bit I have intrigued by it and now I have one. So what is it? It is a 3D array of neopixel-style LEDs, or another way of describing it a programmable box of LEDs (or just good fun). The option I went for the 5x5x5 array (125 LEDs) controlling it with a micro:bit, and the base for mounting and powering the grid. Instructions for putting it together can be found at  https://4tronix.co.uk/blog/?p=1770 . My main bit of advice is read the instructions carefully especially if you go for the 5x5 options, at the time of writing, you need to move a standoff around but it is all in the instructions. Admittedly I missed this step initially.  So to playtime, using a microbit I wanted to spell-out HELLO across the grid using the Micro:Bit JavaScript Blocks/MakeCode Editor. Basically, my solution revolved around creating two JavaScript functions to produce vertical and horizontal patterns on the grid (sounds good saying that -...

Getting Crabby with EduBlock for Microbit

This is really pulling together two recent posts, one when I started playing with Edublocks for the microbit  and one about playing with BinaryBots Crab  . The BinaryBots Totem Crab is available at  https://www.binarybots.co.uk/crab.aspx Here I going to use Edublocks ( https://microbit.edublocks.org/ ) by @all_about_code to control the claw of the Crab to close when button A is pressed (and display a C on the LEDs)  and open the claw when button B is pressed. For a discussion on the Crab and what the pins are, etc goto  http://robotsandphysicalcomputing.blogspot.com/2018/08/crabby-but-fun.html  for more details.  The timing of the opening and closing is controlled by how long the C or O takes to scroll across the LEDs. As an aside, but I found it interesting (it appeals to my geekiness), if you save the blocks, using the Save button; it stores it as an XML file, an example extract is shown below: Now I want to exp...

Speech with EduBlocks on BBC microbit

The microbit is a great piece of kit, not least of which because of the range of programming languages and tools that can be used with it - officially JavaScript and Python and but there is also a range of third-party ones. A useful place to look for what languages/tools  are available is  http://microbit.org/code-alternative-editors/ ; listing both official and third-party tools (there was a few I wasn't aware of ). One I was aware and meaning to play with, is the brilliant Edublocks by Josh Lowe ( @ all_about_code ) or more   specifically in this post Edublocks for BBC Micro:bit  ( https://microbit.edublocks.org/ ). Edublocks for the microbit (and Edublocks in general) allows graphical blocks of code, in a similar way to languages such as Scratch, to be dragged and dropped into places. That in itself would be great, but the really useful thing here is though, whilst doing it you are actually producing a Python program (technically in th...

Scratch 3 that microbit

The Beta version of Scratch 3 ( https://scratch.mit.edu/microbit ) allows certain physical computing devices to interact with the Scratch; including the micro:bit. This post looks at a little experiment with the micro:bit; producing a pen that moves around the screen controlled by tilting a micro:bit. Set-up In the video above an example of the pen moving under micro:bit control is shown. Also, some discussion of setting up Scratch to work with the micro:bit is included. The best source for the instructions to set up the micro:bit/Scratch combination and the links needed is  https://scratch.mit.edu/microbit . The key features are: - The programming of the Micro:bit via Scratch is not done by downloading a new .hex file each time as you do with the python or the javascript blocks but is done through the Scratch Link which has to be run separately to the Scratch editor each time you have a session using Scratch and the Micro:bit. There ...

Crabby but fun

Just started playing with one of BinaryBots latest Totem robots - Crab  https://www.binarybots.co.uk/crab.aspx , which as the name suggests is a crab-like robot kit with controllable via a Microbit a claw.  It is early days playing at the moment, but some initial thoughts. You get a solid looking (and is solid) robot when it is built via a 'meccano-esque ' like construction material - Totem . A brief note on the Totem system is it is nice to build with, the design around the square nuts mean they slot into the structs and stay there - a nice feature, and the all the tools needed to build the structure come with the kit. The only thing missing from the kit is the micro:bit, but if you buying the kit you probably already have one (or more) microbits; or you can get one at the same time as buying the kit. Two boards come with the kit. First one, the power board, has the battery holder and connections for motors. The second the BinaryBot sensor ...

WebVR 4 Playtime: Putting Objects into Augmented Reality

In a previous post , I tried to persuade you that using A-Frame it is not too hard to use for some simple Augmented Reality (AR) for free, via a browser, but also runs on a mobile device. Well I going to continue and put objects with images imposed on them into this AR system - which could be quite a quick way to get an organisations logo into AR. Summary In the first post  WebVR playtime 1: Basics of setting up, images and rotating blocks ,  I looked at setting up a scene, rotating an object.   S econd pos t, recapped the basics, then look at adding video, 360 degree video, and models developed elsewhere.  The third post  started looking at using WebVR as part of an augmented reality solution building on the great resource  Creating Augmented Reality with AR.js and A-Frame  by Jerome Etienne, creator of AR.js. This gave us the starting code.  In this post, the ideas are extended further to adding or ...