Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Thursday 10 May 2018

MSc meets Micro:Bit

I have recently been teaching a module on Internet Programming on a MSc Computing programme (see related links), and was looking for a way to introduce a little bit of physical computing to finish of the module - micro:bits offer a route.

So a bit of context; most of the students on the module had first degrees in either networking or software engineering; so before they start the module they are competent in programming with Javascript, HTML, CSS and PHP. Therefore the module looked to develop new areas such as introductory blockchainvirtual reality via the web (e.g. WebVR), using social media sources; but lastly looking at physical computing leading to an insight into the Internet of Things (IoT). As part of this last topic gaining some experience of programming and very simple networking was looked at using the micro:bit.

An activity was produced where:

  • they, in pairs, initially replicate some code and work out how it worked;
  • they then took the code and experimented with their own ideas.
In all cases they had to produce something that allowed doing something on one micro:bit, caused another micro:bit to do something in response.



Initially, javascript blocks (as above) were used and some students stuck with the graphical blocks, others moved into the text-based version. As far as the activity went it didn't matter; the main goals were to see the programming of a physical device via a web interface; to break a little mystique that it is as ways much harder to program physical devices and to get a bit of very simple networking going on.

Many of the students, started to investigate getting sounds to play on headphones and getting one micro:bit to trigger the other to play. One group went and started playing with python. 

Reflection bit - If I had similar, competent group again I would start this earlier; the level of engagement seemed high and the activities could then start developing towards IoT. Though, I admit to a bias for physical computing, it is appropriate in HE teaching; even using tools primarily designed for schools like the micro:bit.


Related Links
MSc Computing
MSc Computing (Computer Network Engineering)
MSc Computing (Software Engineering)



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 26 July 2017

kitronik :Move mini buggy (JavaScript blocks)

Finally got around to building add playing with the Kitronik :Move https://www.kitronik.co.uk/5624-move-mini-buggy-kit-excl-microbit.html (see below - I decided to put the green sides on the outside - just to be different). One of its features is a vertical set of holes for a pen to be placed in.


Add the blocks (found at https://github.com/KitronikLtd/pxt-kitronik-servo-lite) in blocks editor (https://makecode.microbit.org/) to control the motors. You can do the same thing with writing to the pins, those instructions come with the build instructions, but using the extra blocks  is a little easier to understand. Also add the package for neopixels (type in neopixels in the search box to find them). Two very good tutorials I found useful to start with can be found at:









1. Motor example
I wanted it so that press A on the Micro:bit the robot goes turns right, goes forward, goes back and turns left. 






A stop block does need to be included, without it the :Move will continue moving. The wheels I found can slip on some surfaces reducing the precision, but still fun to play with.

2. At the start and stopping.
I want to use the motors and the 'pixels', but I want to have a known starting position for the motors and set the turning speed; this was possible using the blocks (see below). The pixels are set at this point on pin P0 (see below) as well. 

To stop both the motors and cycling of the pixels - pressing buttons A+B together was set up to this.




3. Rainbow on the pixels.
On pressing button B the pixels rotate through a range of colours.




4. Summary
This is great fun. Having the set of blocks adding for the servos means it is a bit simpler to work 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

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. Micr...