Showing posts with label scratch. Show all posts
Showing posts with label scratch. Show all posts

Thursday, 4 April 2024

Top posts on this blog in March 2024

The Top 10 viewed post on this blog in March 2024. Covering areas such as small robots, augmented reality, Scratch programming, robots.






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

Saturday, 18 July 2020

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 not the standard Scratch 3.



My idea is to can I set it to react one way when I say "hello"; then say "french" and then say "hello" it says "Bonjour". Two other extensions are needed along with the Speech to Text one - one for speech to text and the translate shown below.



Ok, so to the fun bit. The listen and wait, and when I hear blocks are the key new blocks, and they do what they say. The three sets of the code are ones I used for this activity.




Thank you to Machine Learning for Kids for creating such a brilliant Scratch extension - this is well worth a 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

Saturday, 25 April 2020

Programming Robots Virtually 1 - VEXcode VR

For a number of years, I have been playing with robots as a means of developing programming/coding skills with students. The problem is when classes get larger or it is used as part of an assessment there is very rarely enough robots to satisfy all the students Turner and Hill (2008). So
therefore, the search has been on for a tool that allows robots to be simulated, programmed, ideally web-based, free and simple to use. Lately, a number of interesting tools have arisen. In this series of posts, I am going to look at experimenting with a few of them. In this post, starting by looking at VEXCode VR - available at https://vr.vex.com/.





VEXcode VR https://vr.vex.com/  from VEX Robotics (https://www.vexrobotics.com/) is a simulator and programming tool for their Scratch-like programming tool VEXCode - at the time of writing is free. If you can do Scratch this is a nice next stage, consisting of the simulator (playground) and the programming environment (see below and the video above.)




Playgrounds
These are the simulated environments you can select from, with a two camera-views; downward camera for overhead view and angled camera to give a 3D view (as shown in the video) via buttons on the bottom right hand side of the playground. Also you can toggle, using the third button on the right hand side, the ability to see the status of the various sensors. There are a number of different playgrounds to play with. In this post I am going to use two of them



Example 1: The Square
Using the Grid Map playground and angled camera. I wanted to start with a stand-by; getting the robot to move in a square. The robot moves forward for 30mm and then turns right 90 degrees; and this is repeated 4 times (see below)
So the commands are very scratch-like. I was impressed,  the 3D gave a clear view it in action, the commands were intuitive and (yes repeating myself) very easy to transfer to from Scratch.



Example 2: Playing with Sensors a bit
Now for more fun, getting it to react to the environment a bit; by changing the Playground to Castle Crasher you get an environment that has simulated blocks and red perimeter to interact with. As you would hope, there are sensing blocks including LeftBumper and RightBumper - no guesrss for what they do and DownEye which can detect the red line. The code is simple and shown below, based on detecting the block using the bumpers, move to the side and recheck if  (shown  below) is if a  block is in-front and if not go forward. If it finds the red line reverse back and rotates 180 degrees.



As a side project I wondered what would happen if you didn't put code in to detect the red line, how would it cope with falling off the surface; it simulates it quite well showing it falling off which quite fun. One mistake I made initially is accidentally selecting the wrong form of turning action rotating when it should have been a turn.


Overview so far...
If you can already use movement, sensing and control blocks in Scratch, you can do this. Has potential as a source of online activity's, especially as the time of writing in the UK we are 'social-distancing'. In their paper Turner and Hill (2008) also highlighted that robots are a difficult resource to manage for a large class; this kind of option allows simulation and programming of a robot to be tried out without actually having the robot. Most importantly it is fun.


Reference
Turner S and Hill G(2008) "Robots within the Teaching of Problem-Solving" ITALICS vol. 7 No. 1 June 2008 pp 108-119 ISSN 1473-7507 https://doi.org/10.11120/ital.2008.07010108




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

Monday, 19 November 2018

Webcam and Scratch

I have to admit I do enjoy playing with Scratch. I heard you can connect a webcam to Scratch and though there might be quite a lot of set-up. I was wrong, it is was very easy just one block really. So in this very short post, I share my (very simple) code. Getting Scratch the Cat to follow my finger left or right.





I am intrigued to see what else can be done.

Code is at https://scratch.mit.edu/projects/263334488/ 

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

Wednesday, 8 August 2018

Scratch 3 that microbit

The Beta version of Scratch 3 (https://scratch.mit.edu/microbit) allows certain physical computing devices to interact with the Scratch; including the micro:bit. This post looks at a little experiment with the micro:bit; producing a pen that moves around the screen controlled by tilting a micro:bit.




Set-up
In the video above an example of the pen moving under micro:bit control is shown. Also, some discussion of setting up Scratch to work with the micro:bit is included. The best source for the instructions to set up the micro:bit/Scratch combination and the links needed is https://scratch.mit.edu/microbit. The key features are:
- The programming of the Micro:bit via Scratch is not done by downloading a new .hex file each time as you do with the python or the javascript blocks but is done through the Scratch Link which has to be run separately to the Scratch editor each time you have a session using Scratch and the Micro:bit. There is a version for both windows and OS X.
- One program/hex file is downloaded on to the micro:bit to form the link between the micro:bit and scratch.


Microbit and Pens
The experiment was to get a micro:bit to control a pen around the screen and draw (the video above shows the pen moving around under micro:bit control but not drawing).


The key to all of this the little blue icon at bottom left of the editor; this allows extra blocks/features to be added. You first need to connect a micro:bit; click on the blue icon and select the micro:bit option and attach a micro:bit to your machine, the system should (hopefully) allow you to make a connection. As well as the micro:bit blocks you will need to add the pen blocks via the blue icon and the pen option.
The code (see below) does two basic things
- Press button B on the micro:bit resets the pen to a fixed starting point;
- Tilting the micro:bit forwards and backwards (once the green flag has been pressed) moves the pen forward or backwards in the direction that the pen is facing and tilting left or right turns the pen.




At the moment the pen is drawing as if the nib is in the middle of the pen (see below) but tilting the micro:bit does give rough control. It is fun, to mix Scratch and micro:bit.






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

Friday, 30 June 2017

Cozmo is programmable

The incredibly cute robot Cozmo became even more engaging recently with the ability to program it. A recent update to the Cozmo app (see related links) to include Code Lab allowing programming of Cozmo through of a graphical programming approach based on Scratch Blocks.





An example of the code is shown below, getting Cozmo to:

  • Start moving around
  • Wait until it see a face
  •       Says Hi Everybody 
  •       Moves forward
  •       Sounds like a cat
  •       Looks down and then raises it's forks
  •       Acts 'grumpy'
  •       Acts 'happy'




The video at the end shows this in action.


It is an easy to use tool and with a lot of the Cozmo actions available in the blocks, put a few blocks together and very quickly you have Cozmo doing some interesting and often funny actions. Is it very flexible, no; but it is not meant to be - it is meant to be easy to use and it is and great fun. Personally, I felt the app needed this addition, it adds the element to take this toy further into a coding toy (yes another one) that it feels, to me, it should be.







Related posts
Cozmo-Wall-E has a rival
Cozmo is coming to the UK
Android app
iPad app




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

Sunday, 26 March 2017

Phiro Pro Robot - a little box of fun.

Phiro Pro is a recently released education robot kit from Robotix Learning Solutions. Designed to be flexible, you can add LEGO to it or work without it; sensors on the sides, front and bottom; built-in speaker and RGB controllable 'headlights'.



One of the other interesting features is the robot can be controlled in three general ways/modes:

  • Using buttons on the robot to enter a sequence of moves - a bit like a Bigtrak
  • Using swipe-cards (see the figures below)
  • Programming using:
    • Scratch - Mac or PC
    • Snap4Phiro - Arduino programming PC/Mac/Linux basded.
    • Pocketcode on smartphone.



The first two are fun and are also available on their lower-priced Phiro Unplugged version, but the real (for me any way) is programming it. So far I have only played with the Scratch instructions (see below) - getting it to move to key presses and to get the 'headlights' to cycle through a range of colours.




The software is free to download and there are numbers of lessons and activities on the site - the only criticism of the site is the manuals for the software were not very easy to find,  included in the section for the lesson  (though I might have missed another way to get to them).

Setting it up is up is relatively easy, but the instructions need to followed carefully - I set-up the software in the wrong folder (not following the instructions properly) and it delayed geeting it working. It is good fun to play with in all the modes (my favourite is programming though). 

The stated research backing is good to see on the website, but then I am biased (see the last one).





More about this robot kit can be found at http://www.robotixedu.com/phiro.aspx or Twitter at 


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

Monday, 28 November 2016

Scratch for Neurones



1. Single Neurone


Instructions:


  • Set the inputs by pressing the buttons marked input 1 and input 2 (Red is off(False or 0) and Green is on(True or 1))
  • Change the weights by changing weights 1 to 3, wx goes with input x and weight 3 is the bias.
  • To activate the neuron you need to click on the the yellow ball ('the neuron').

The video below show it in action and explains the code.



To see the code go to https://scratch.mit.edu/projects/131892234/ .

A slight modification click on the bell to change the weights

The code is available at https://scratch.mit.edu/projects/171190294/

2. Training a Neurone
In this part, the training of a neuron all written in Scratch is tackled. The video shows it action and you can have a go at using the software yourself at the end of the post. The Scratch code can be found at https://scratch.mit.edu/projects/132915502/






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

Thursday, 31 March 2016

mBot - cute, fun and Arduino based

I have had an opportunity (ie, the time) to play with mBot, Scratch Programmable Robot using the mBlock software which appears to be a modified version of Scratch - so relatively easy to use. They have added a section of blocks, to the standard set, marked Robots containing blocks for both Arduino and mBot. 

An earlier blog post (mbots - graphical programming and Arduino) discuss some of the basics of the robot. Just for fun I wanted to play with the ultrasonic sensor, getting the robot to react, change direction (run away) and the 'face' on an LED matrix that came with the robot if there is an object in the way.



The routine
  • Loop
    • Show a smiley face (using Port 4 )
    • If the ultrasonic detector senses something close (guessed at a setting of 10)
      • Go backwards quickly
      • Play a tone
      • Show an upside-down smiley face 
      • wait 1 sec
    • Otherwise
      • Move forward
  • End the loop


Download the code to the mBot using the Upload to Arduino button (see below). Here is where you find out whether you have set the system up correctly. In the mBlock editor pull down menu choose Connect and select the required connection; I have been using a USB cable so I needed to select the serial option and select the USB hub. After that using the Upload to Arduino button did lead to the code downloading.






The video below shows it in action






This is good fun, and a very cute. The build quality of the bots (not my building ability) the metallic construction means the bots feel substantial.  The software as it is Scratch based I think it will be interesting to try it out with my Code Clubbers - especially as they have been asking to play with more robots.

As always I would be interested to hear from others on their experiences of using this little robot.

Related links
mbots - graphical programming and Arduino






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.

Thursday, 25 February 2016

MakeyMakey at Beavers


Recent had a great time playing with a MakeyMakey board (see an example below taken from an Amazon site) with some Beaver Scouts. 

The basis of the activity was a very simple scratch program; where the 'space' key (banana number one) played one recording and 'left key' (better know as banana number two) played another recording. 



Started with a few drum sounds, but when the session really took off was when they started recording their own sounds. Lots of shouts, shrieks and names but it engaged them…and left me with two very smashed up bananas.

Details of the MakeyMakey boards can be found at: http://www.makeymakey.com/

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.

Remote Data Logging with V1 Microbit

In an earlier post  https://robotsandphysicalcomputing.blogspot.com/2024/08/microbit-v1-datalogging.html  a single microbit was used to log ...