- / The ever-brilliant 4tronix have produced Eggbit https://shop.4tronix.co.uk/collections/microbit-accessories/products/eggbit; a cute, wear...
- Finally got to play with something that has been my list of things to play with, the Pimoroni Enviro:bit Weather Kit https://learn.pimoroni...
- The Raspberry Pi Foundation recently released a programming activity Alien Language , with support Dale from Machine Learning for Kids , tha...
- In a previous post, the Envirobit ( https://shop.pimoroni.com/products/enviro-bit ) for the Microbit was played with getting temperature,...
- In two recent posts, Makecode was used with the Enviro:bit from Pimoroni to try out a few ideas ( https://robotsandphysicalcomputing.blogspo...
- Speech Recognition in Scratch 3 - turning Hello into Bonjour! The Raspberry Pi Foundation recently released a programming activity Alien Lan...
- Guest Blogger Hiren Mistry, Nuffield Research Placement Student working at the University of Northampton. How to use a PS3 Controller to...
- It is not physical but CBiS Education have release a free robot arm simulator for Scratch. Downloadable from their site http://w...
- This post forms part of occasional posts about playing with Marty the Robot V2 ( https://shop.robotical.io/products/marty-the-robot-v2 ) fr...
- I am going to try to persuade you that using A-Frame it is not hard to do some simple Augmented Reality (AR) for free, via a browser, but th...
Robots and getting computers to work with the physical world is fun; this blog looks at my own personal experimenting and building in this area.
Thursday, 1 July 2021
June 2021 - 10 Most viewed Blog posts on Robots and Physical computing Blog
Tuesday, 29 June 2021
Microbit and Environment Measurement - Using Python
In two recent posts, Makecode was used with the Enviro:bit from Pimoroni to try out a few ideas (https://robotsandphysicalcomputing.blogspot.com/2021/06/pimoroni-envirobit.html and https://robotsandphysicalcomputing.blogspot.com/2021/06/pimoroni-envirobit-light-and-led.html ). In this post Pyton using the Mu editor was used to try out the Enviro:bit.
As in the makeCode version, Pimoroni has provided both a python library (via Github) but also within the Readme.md useful installation instructions. There is at the time of writing a possible typo; to get the BME280 sensor (temperature, pressure, humidity sensor) to work; you need to add parenthesis in the line bme = bme280.bme280()
After that, it works fine and includes potential altitude measurement which I don't think is in the Makecode version (though I could be wrong); I need to play with it a bit more.
To experiment the code below was used test reading temperature (in Centigrade), humidity (%), and altitude (feet). In the examples, currently provided with the library, I couldn't find a BME280 example but it was fairly easy to adapt the examples included to get something going.
import microbit
import bme280
bme = bme280.bme280()
while True:
reading = bme.temperature()
microbit.display.scroll("temp: ")
microbit.display.scroll(str(reading))
microbit.sleep(3000)
reading = bme.humidity()
microbit.display.scroll("humidity: ")
microbit.display.scroll(str(reading))
microbit.sleep(3000)
reading = bme.altitude()
microbit.display.scroll("Alt: ")
microbit.display.scroll(str(reading))
microbit.sleep(3000)
It is a cool and fun device to play with, though I not sure the precision of the readings shown on the microbit LEDs is really necessary :-)
Monday, 28 June 2021
Pimoroni Envirobit - Light and LED
In a previous post, the Envirobit ( https://shop.pimoroni.com/products/enviro-bit ) for the Microbit was played with getting temperature, humidity and pressure (https://robotsandphysicalcomputing.blogspot.com/2021/06/pimoroni-envirobit.html).
In this short post a quick experiment using the sound and light sensor, to turn LEDs on the board to turn off and on beyond on light level. The code is set up when a clap happens nearby, light level is used to 'decide' whether the LEDs are turned on or off, below a threshols the LEDs go on above it the LEDs are turned off,
Makeecode |
Using Makecode makes this relatively easy to implement and fun.
Monday, 21 June 2021
Pimoroni Enviro:bit -
Finally got to play with something that has been my list of things to play with, the Pimoroni Enviro:bit Weather Kit https://learn.pimoroni.com/tutorial/tanya/building-the-enviro-bit-kit (see below)- a nice kit based around Pimoroni's enviro:bit device which uses microbit and adds a number of sensors including temperature, pressure and humidity; as well as a microphone.
Programming is via MakeCode; extensions can be added using the Extension option and searching for envirobit.
So a quick experiment to work through the temperature, pressure and humidity sensors, a brief bit of code to do this is shown below:
Responding to sound
The microbit used with the kit was a V1, so this device added a microphone to the systems (V2 already has the microphone built-in). In the code below the microbit to react to a clapping sound.
There is still various things to try out the like the light sensors. As well as the expert blocks - what their functions are.
To develop further.
Fun and easy to play with.
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
Code available:
Saturday, 12 June 2021
4tronix Eggbit - cute and wearable - hug avoider
The ever-brilliant 4tronix have produced Eggbit https://shop.4tronix.co.uk/collections/microbit-accessories/products/eggbit; a cute, wearable device, with ultrasonic sensors, buttons and LEDs for the microbit - I couldn't resist.
Programming is through Makecode and an extension is available, to download and install. To use the extension, at the time of writing this, go through the add extension option and use the search box to add it from https://github.com/4tronix/EggBit
So what to do with it? Inspired by social distancing (or not being a 'hugger') created it so that when people get too close the RGB LEDs go out - simple but fun. The distance is set at 20cm for testing. The code is shown below.
It was fun to do and perhaps swapping the settings around so the lights come on when people at too close might be more fun or using sound. This is a lovely device to play with and the look encourages play - just look how cute it is! The price is reasonable and the look means it has the potential to encourage a wide range of people to experiment with it.
Monday, 31 May 2021
10 mosts read posts on the Robots and Physical computing Blog - May 2021
- The Raspberry Pi Foundation recently released a programming activity Alien Language , with support Dale from Machine Learning for Kids
- I often play with the brilliant Sonic Pi https://sonic-pi.net/ for a bit of fun, but let's be clear I have no musical ability.
- Most read posts on the Robots and Physical computing Blog Popular posts from this blog Make yourself a virtual gallery
- The free online CAD (and so much more) package Tinkercad https://www.tinkercad.com/ under circuits; now has microbits as part of the list
- 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 simulation.
- Guest Blogger Hiren Mistry, Nuffield Research Placement Student working at the University of Northampton.
- I wanted to contol the CBiS micro:Bit Car via gestures whilst holding another micro:Bit
- It is not physical but CBiS Education have release a free robot arm simulator for Scratch.
- This is second in a two-post series on building a neural network using microbits with micropython.
- In previous posts ( post 1 , post 2 ) I have raved over the brilliant combination of Mozilla's AFrame and Jerome Etienne's fantastic AR.js
Saturday, 8 May 2021
Quick Play with SonicPi
I often play with the brilliant Sonic Pi https://sonic-pi.net/ for a bit of fun, but let's be clear I have no musical ability.
To get my head around it I tried turning thee one tune I know "Hot Cross Buns" for the recorder into a tune. I found a useful webpage https://newt.phys.unsw.edu.au/jw/notes.html to turn the notes into the MIDI number (60, etc) . Played with the synthesier sounds and choose tech_saw just because I liked it. The code is below
use_synth :tech_saws
2.times do
play 71
sleep 0.5
play 69
sleep 0.5
play 67
sleep 0.5
end
4.times do
play 67
sleep 0.25
end
4.times do
play 69
sleep 0.25
end
play 71
sleep 0.5
play 69
sleep 0.5
play 67
Also tried it with changing the synth to prophet
Also tried to make it a bit more mournful (possible slightly aggressive) with minor chords - I used https://en.wikipedia.org/wiki/Minor_chord#:~:text=In%20music%20theory%2C%20a%20minor,is%20called%20a%20minor%20triad. to get the notes in combination with the MIDI notes list (I still think I got it wrong!)
use_synth :prophet
2.times do
play 71
play 62
play 66
sleep 0.5
play 69
play 60
play 64
sleep 0.5
play 67
play 70
play 62
sleep 0.5
end
4.times do
play 67
play 70
play 62
sleep 0.25
end
4.times do
play 69
play 60
play 64
sleep 0.25
end
play 71
play 62
play 66
sleep 0.5
play 69
play 60
play 64
sleep 0.5
play 67
play 70
play 62
sleep 0.5
Adding sound effects is great fun - same code as above with a slightly techno sound to it
use_synth :prophet
with_fx :ixi_techno do
2.times do
play 71
play 62
play 66
sleep 0.5
play 69
play 60
play 64
sleep 0.5
play 67
play 70
play 62
sleep 0.5
end
4.times do
play 67
play 70
play 62
sleep 0.25
end
4.times do
play 69
play 60
play 64
sleep 0.25
end
play 71
play 62
play 66
sleep 0.5
play 69
play 60
play 64
sleep 0.5
play 67
play 70
play 62
sleep 0.5
end
or alternatively
use_synth :prophet
with_fx :ixi_techno do
2.times do
play chord(:b4, :minor7)
sleep 0.5
play chord(:a4, :minor7)
sleep 0.5
play chord(:g4, :minor7)
sleep 0.5
end
4.times do
play chord(:g4, :minor7)
sleep 0.25
end
4.times do
play chord(:a4, :minor7)
sleep 0.25
end
play chord(:b4, :minor7)
sleep 0.5
play chord(:a4, :minor7)
sleep 0.5
play chord(:g4, :minor7)
sleep 0.5
end
I am the first to admit I have little musical knowledge but playing with Sonic Pi is still good fun; just changing the sound effects (like changing it to whammy and getting it sounding like aliens) is enjoyable.
Subscribe to:
Posts (Atom)
Who wants to produce AI produced cartoon strips
Question: How easy is it produce a comic/cartoon using genetative AI? Let's start with using ChatGPT4o to produce cartoons. The idea wa...