Friday 12 May 2023

Final sessions before Summer 2023 break will be using App Inventor

App Inventor is a brilliant free, online portal from MIT to allow people to make Android apps.

You register and sign in at: http://ai2.appinventor.mit.edu/

I have been using it for a few years and have lots of coding examples.

Tomorrow's sessions with be examining the "Don't Shake Me" app.




Above is the "Designer" view and below is the "Blocks" view:



It works by adding the AccelerometerSensor from Sensors and TextToSpeech from Media

I connect to and Android phone using a 4G GSM connection and running the AI Companion App (which must be installed on the phone) to scan the QR code presented by App Inventor screen.

When the app is run on the phone it will say "Stop Shaking Me" whenever the phone is shook

Here's it in use:

https://youtu.be/p08pQqWouBg






Sunday 7 May 2023

Kitronix Two Wheeled MOVE: Buggy Micro:Bit Code

I thought I'd document how to code the Kitronix Two Wheeled MOVE: buggy in Micro:bit.
https://kitronik.co.uk/products/5652-move-mini-mk2-buggy-kit-excl-microbit




Here's a picture of the receiver code that runs on the buggy:


It operates by listening on radio group 1 for a number from 0 to 4. These represent the commands: STOP, TURN_RIGHT, TURN_LEFT, GO_FORWARDS and GO_BACKWARDS.

The code is also available at: https://makecode.microbit.org/_ekWCkL5H6JvY

And the hex file at: https://drive.google.com/file/d/1iK9lTVpczdeoaCo-ud3FbashRBOD7bxc/view?usp=sharing

By pressing button A the radio group can be incremented. An example of frequency hoping to stop many default transmitters controlling the buggy at once on group 1. Some interesting reading here: https://en.wikipedia.org/wiki/Hedy_Lamarr

The above code also illustrates to students the use of capitals for constants (i.e TURN_LEFT represents the number 1 and saves you having to remember this

It also makes paramaterised function calls.

NOTE: You need to add the Neopixel and Kitronix Buggy extensions to the editor


The transmitter code makes use of the accelerometer on the Micro:bit to allow for control of the buggy by tilting the Micro:bit in your hand,

Here's its code:




It doesn't require any Micro:bit extensions to be loaded. It's code is available at: https://makecode.microbit.org/_5LU5ateMM3Ru

And at: https://drive.google.com/file/d/14RTpUGfLKy_Y-GtDkIxWoT1wiVrsHF9b/view?usp=sharing