Skip to main content

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 :
      display "Hello, UFO called me"

Micropython code
import radio
from microbit import pin0, pin1, display, sleep

radio.on()

while True:
   incoming = radio.receive()
   if incoming == 'ufo':  
      display.scroll("Hello, UFO called me", 75)
   if pin0.read_analog()<175:
        display.scroll("calling UFO")
        radio.send("dimm")
   else:
        display.scroll("I can't see")

Stage 3 Testing

Video below shows it in action including what happens when the light (in this case a torch) shines on the sensor connected to Dimm; a message is sent and picked up by the UFO kit (LEDs flash and the message saying "DIMM calling" scrolls  across the UFO LED array - see UFO talks to robot - part one for more details). A message is sent back from the UFO kit and on Dimm's LED array the message "Hello, UFO called me").
If the light levels are too low then the message "I can't see" scrolls across Dimm's LED array.






As an aside, the Dimm robot still reminds me, a little, of a colourful, friendly, Ood from Dr Who with all the leads hanging out of the 'mouth' - think that is geeky I know.




All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Comments

Post a Comment

Popular posts from this blog

Robot Software

In the previous blog posts for this 'series' "It is a good time...."  Post 1  looked at the hardware unpinning some of this positive rise in robots; Post 2  looked at social robots; Post 3  looked at a collection of small robots; Post 4 looked at further examples of small robots Robots, such as the forthcoming Buddy and JIBO, will be based some established open sourceand other technologies. Jibo will be based around various technologies including Electron and JavaScript (for more details see:  http://blog.jibo.com/2015/07/29/jibo-making-development-readily-accessible-to-all-developers/ ). Buddy is expected to be developed around tools for Unity3d, Arduino and OpenCV, and support Python, C++, C#, Java and JavaScript (for more details see http://www.roboticstrends.com/article/customize_your_buddy_companion_robot_with_this_software_development_kit ).  This post contin ues with some of the software being used with the smaller robots.  A number ...

Speech Recognition in Scratch 3 - turning Hello into Bonjour!

The Raspberry Pi Foundation recently released a programming activity Alien Language , with support Dale from Machine Learning for Kids , that is a brilliant use of Scratch 3 - Speech Recognition to control a sprite in an alien language. Do the activity, and it is very much worth doing, and it will make sense! I  would also recommend going to the  machinelearningforkids.co.uk   site anyway it is full of exciting things to do (for example loads of activities  https://machinelearningforkids.co.uk/#!/worksheets  ) . Scratch 3 has lots of extensions that are accessible through the Extension button in the Scratch 3 editor (see below) which add new fun new blocks to play with. The critical thing for this post is  Machine Learning for Kids  have created a Scratch 3 template with their own extensions for Scratch 3 within it  https://machinelearningforkids.co.uk/scratch3/ . One of which is a Speech to Text extension (see below). You must use this one ...

Escape the Maze with a VR robot - Vex VR

You don't need to buy a robot to get programming a robot, now there are a range of free and relatively simple to start with robot simulators to play with. Three examples are listed below: - Make code for Lego EV3  https://robotsandphysicalcomputing.blogspot.com/2020/05/programming-robots-virtually-3-lego-ev3.html   - i Robot simulator  https://robotsandphysicalcomputing.blogspot.com/2020/04/programming-robots-virtually-2-irobot.html - Vex robotics Vexcode VR   https://robotsandphysicalcomputing.blogspot.com/2020/04/programming-robots-virtually-1-vexcode.html   It is the last one of these ( https://www.vexrobotics.com/vexcode-vr ) that is the focus of this post and return to hit, after an earlier discussion in  https://robotsandphysicalcomputing.blogspot.com/2020/04/programming-robots-virtually-1-vexcode.html   .  Two of the nice things about the package, apart from being free, are it uses a Scratch-like programming language and it provides a ...