In an earlier post this year ( 4tronix Eggbit - cute and wearable - hug avoider) I played with 4Tronix's Eggbit (in fact I bought three of them https://shop.4tronix.co.uk/collections/bbc-micro-bit/products/eggbit-three-pack-special :-) recently). In that one I used a microbit V1.
In this post, I am using a microbit V2 and replicating the idea but with adding a sound; when people get too close as a bit of fun and surprise for relatives at christmas.
The code written using Makecode for Microbit (https://makecode.microbit.org/) and the extension for it 4Tronix's developed (see https://4tronix.co.uk/blog/?p=2485 for more details) is shown below:
If the ultrasonic sensor picks up anyone in front; LEDS change to red, a sped-up version of one of the standard tunes in Makercode is played and the mouth changes to a surprised look.
Good fun, didn't stop anyone and my son made one with the LEDs lighting up as the person got closer.
What I want to look at is the possibility of programming it with Python - something for the new year.
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
No comments:
Post a Comment