Skip to main content

Posts

Showing posts with the label radio

Gesture controlled python robot unicorn (or is it a rhino)

In the previous two post I built and played with a robot unicorn from  Do it Kits https://doitkits.com/product/robot-unicorn/ . In the first post,  python was used to get it to move forward, backwards, left, right and stop. The second post discussed using a second microbit to send the movement instructions via the microbit's  radio module. This post looks at extending the idea to using the accelerometer to pick up directions and send them to the robot unicorn (that still seems weird to write). Microbit's accelerometers, using the x and y directions, provide the inputs and then send the direction commands. The robot unicorn code is the same in the second post , the new code for the gestures is shown below.  This a work in progress it detects x and y changes together so it does have a tendency to do one direction and then the other. This needs further work. All my code for the robot unicorn projects can be found at:  https://github...

Radio controlled microbit Robot Unicorn

In a previous post a robot unicorn was built from a kit ( Do it Kits  https://doitkits.com/product/robot-unicorn/ ) and controlled to do a fixed sequence of actions. In this post a similar thing will be done, but this time the actions are not fixed within the robot itself, but in response to messages sent from another microbit via the radio module. Sending Sends out messages via the microbit's radio module, e.g. fwd for forward or tr for turn right; as well the name of the actions scrolls across the microbit. On the Unicorn Revieves messages via the microbits radio module, e.g. bwd for backward or tl for turn left; then carries out the action for 500ms. The time was selected to give the system enough time to finish the action before the next message is expected. All the code available at  Turner, S., 2017.  Robo_unicorn_python . Available at: <Robo_unicorn_python>  https://doi.org/10.6084/m9.figshare.5729583.v7 All opinions in this bl...

UFO talks to Robot - part two

In part one of this series of posts , the project to get Consumable Robotics UFO and Dimm robot was started but focussed on the UFO kit. The goal being for some action on Dimm to trigger a series of messages being passed between the two of them. In this post, the focus moves to Dimm and the setting up the actions leading to the messaging. Stage 1 Build Using the Micro:bits port 0 (as part of the Dimm robot) for the input from the light sensor, which is included in the kit (Red lead going to 3v and the black lead going to GND). Just to note the less light there is the higher the value on the sensor. Stage 2 Code Micropython programmed through the Mu editor (see below) If light levels are high then :       scroll a message saying "calling UFO"        send the code "dimm" via bluetooth. otherwise:         scroll a message saying  "I can't see" If it recieves "ufo" via bluetooth...

Do it yourself: Remote Controlled Micro:Bit Junkbot

In an earlier post , I showed how you could build a Micro:Bit controlled Junkbot. In this post I want to show a modification to it, to use one Micro:Bit to control the junkbot controlled by another Micro:Bit. A nice feature of the Micro:Bit using micropython, is it can send and receive simple messages via radio - so here is my take on it. The first problem is the Python editor available on  https://www.microbit.co.uk/ does not seem to work with the radio API. One solution to this is to change to the mu editor. Two pieces of code are needed. Sending Code for the 'remote' control: Essentially it is set up to send two messages, via the built-in radio module,  spinl  or spinr  depending on which button is pressed. import radio from microbit import button_a, button_b radio.on() while True:    if button_a.is_pressed():        radio.send('spinl')    if button_b.is_pressed():        ra...