Skip to main content

Posts

Showing posts with the label kitronik

Dancing Kitronik's Game Zap - reacts to music

You will glad to hear this is only a short post.   In an earlier post, Build a Disco Cube:bit that reacts to music ; the vibrations of music, makes the cube sitting on a speaker with the volume pushed to 11 (just to test it of course) react to the music. The accelerometers values in the micro:bit, in the three axis, are feedback to change the neopixels colour. Simple but good fun. With some very minor (and I do mean minor) changes it works on the Kitronik's Game Zap - eight pixels are altered at a time instead of five but apart from that nothing more. The code in python is shown below: from microbit import * import neopixel, random np = neopixel.NeoPixel(pin0, 64) while True:     for pxl in range (3,64, 8):         rd=int(abs(accelerometer.get_x())/20)         gr=int(abs(accelerometer.get_y())/20)         bl=int(abs(accelerometer.get_z())/20)         np[pxl] = (rd, gr, 0)   ...

kitronik :Move buggy (Python controlled servos)

In a previous post I looked at controlling the Kitronik :Move buggy using Javascript based blocks . In this short post I will show  controlling the servos of the micro:bit based :Move buggy with Python. Control is via pin1(left motor) and pin2 (right motor) and the motors have to be driven in opposite directions to move forward or backwards. The direction of the motors is controlled by the analogue value written to the pins;   pinX.write_analog(180) - anticlockwise or  pinX.write_analog(1) - clockwise ( pinX.write_analog(0) - stops the motor). Setting the analog_period seems to work at 20ms; this was found by experiment, discussed in a previous post . So the initial code below sets up the moves for forward, backward, turn left, turn right all controlled with a move for so many milliseconds. Code  from microbit import * pin1.set_analog_period(20) pin2.set_analog_period(20) def forward(N):     pin1.write_analog(180...

kitronik :Move mini buggy (JavaScript blocks)

Finally got around to building add playing with the Kitronik :Move  https://www.kitronik.co.uk/5624-move-mini-buggy-kit-excl-microbit.html  (see below - I decided to put the green sides on the outside - just to be different). One of its features is a vertical set of holes for a pen to be placed in. Add the blocks (found at  https://github.com/KitronikLtd/pxt-kitronik-servo-lite ) in blocks editor ( https://makecode.microbit.org/ )  to control the motors. You can do the same thing with writing to the pins,  t hose instructions come with the build instructions, but using the extra blocks  is a little easier to understand. Also add the package for neopixels (type in neopixels  in the search box to find them). Two very good tutorials I found useful to start with can be found at: Neopixels on the robot  in blocks - https://www.kitronik.co.uk/blog/using-kitronik-zip-leds-bbc-microbit/ Servos on the robot in blocks -  ht...

Micro:bit, Servo control with Micropython or blocks

You can control servos (small ones) from a Micro:Bit directly. Following a link from the David Whale (Twitter  @ whaleygeek ) , thank you, took me to a Kitronik blog post, https://www.kitronik.co.uk/blog/using-bbc-microbit-control-servo /, which has the answer. The code uses Microsoft Blocks taken from the post, runs the servos 180 degrees and back again, when button A is pressed. It does exactly what it should. I am also using the Tower Pro SG90 servo. Can it be replicated in Micropython? This is a new mini project, there seems to be little out there yet on how do this but the best so far is this video by  PHILG2864 : The closest I have is the following, it is essentially there. from microbit import * pin0.set_analog_period(20) while True:     pin0.write_analog(180)     sleep(1000)     pin0.write_analog(1)     sleep(1000) Setting the time period to 20ms   pin0.set_analog_period(20) seems by experiment (...

How to do it yourself: Microbit Junkbot

What is a Junkbot? For this project, it is a moving ‘bot’ made from waste materials, combined with an electric motor and a programmable device (in this case a Micro:Bit) to control (or try) it. An example is shown below. More details on junkbots can be found at  http://junkbots.blogspot.co.uk/ Stage 1 - The start of a Junkbot This stage is relatively simple. Tape some pens or straws to a drinks can. Stage 2 - Physical arrangement of Microbit and motor control board The control part is this via a Micro:bit ( http://www.bbc.co.uk/programmes/articles/4hVG2Br1W1LKCmw8nSm9WnQ/the-bbc-micro-bit) . Kitronik produce a motor driver board, and provide quite a bit of support for it, for the Micro:Bit (the latest version of the board can be found at  https://www.kitronik.co.uk/5620-motor-driver-board-for-the-bbc-microbit-v2.html  ). A 6v battery pack is connected (see on the left of the image) and wires going to a motor are attached to the ...

Micro:bit Junkbot for use in schools

A new direction has been developed for the junkbot project ( http://junkbots.blogspot.co.uk/ ) ; previously Raspberry Pis have been used to control the junkbot’s movement ( http://robotsandphysicalcomputing.blogspot.co.uk/2016/01/python-junkbot.html )  – but what about the recently released Micro:Bits; can it be used to control a junkbot? Matthew Hole, a student from Wrenn Academy, Northamptonshire ; has been investigating this idea whilst on a Nuffield Research Placement ( http://www.nuffieldfoundation.org/nuffield-research-placements) working with Dr Scott Turner, University of Northampton. The project was to look into developing junkbots controlled using a Micro:bit and also to produce some materials for schools to use with or without outside assistance. What is a Junkbot? For this project, it is a moving ‘bot’ made from waste materials, combined with an electric motor and a programmable device (in this case a Micro:Bit) to control (or try) it. A...