Sometimes it´s good to have a display to show some things in a robot. However displays can be very complicated to handle and energy consuming, unless you use the LED Matrix for mBot.
Here you have a simple but useful display where you can show anything you can imagine with the dot size of a small LED. It´s not very precise but bright and simple enough to show many useful things.
My first test was the "Hello world" in our own version: "LMR", as show on the picture of this article. Code is ready to download and use here.
After that I though could be good to combine two functions of the robot: ultrasound sensor and LED Matrix. Code is here: ultrasound sensor and the LED Matrix. Here you have the video for this experiment (also right above this article).
The program to make this possible is very easy, have a look here:
Basically mBot does this:
- sets "y" as the first position for writing on the display
- sets "x" is the distance measured by the ultrasonic sensor
- shows on the display the distance (x)
- waits for 0.001 seconds to measures again and refresh the value
I´m not sure if the sensor and/or the display can go so fast, but I just tried with several values and this one looks fine to show an updated distance as soon as it changes. There are some glitches sometimes in the measure (see the video), I think due to noise. I can filter them out with some more programing, let´s see...
I´ll keep programming new tricks with this display as it can be useful also to interact with humans, included children when playing with the robot!
What application do you think can be interesting?
See past reviews I did about this robot here:
- mBot robot kit: 1st part of review. Unboxing
- mBot robot kit: 2nd part of review. Assembly the robot
- mBot robot kit: 3rd part of review. Programming the robot
- mBot plus: artificial vision via Raspberry Pi