Coding

Simple coding, aka programming, of computer systems is currently extremely popular and can almost be regarded as mandatory in schools in the UK. There is a large variety of platforms that can be used, from traditional PCs and MACs through to Raspberry Pis and Arduinos. (and don’t forget the older generation of products like Flowol together with a FlowGo box – arguably just as effective for teaching Control Technology). Programmes can be designed to modify what appears on a screen through to the world of Physical Computing – reading sensors and sending control signals out to motors, LEDs etc.

Each of these platforms has its own native programming languages which can make it difficult to know where to start and what will work with what.

Also, trying to decide which platform and which language to use use in a teaching environment is hard, should you start by considering the hardware you’ve already got e.g. PCs, MACS, Raspberry Pis etc; or would it be better to choose a programming language and see what you need to run it on? Frankly it feels like Chicken & Egg – which should come first?

In the section below we choose to base it on the language, so for example Scratch is a simple visual language that may be more suitable for younger children. At the end of the section there is a grid of videos that show the various combinations in use by various groups both in the UK and globally.
using motors with gPiO

Using motors with the gPiO box.

Note.  if you just want a motor to turn in one direction you can use the standard outputs on the top of the gPiO box. The notes below are for a) when you are using motors and need to control the motors by varying the forward and reverse speed of the motor and/or b) when you need to control a more powerful motor (the top outputs are limited to 300mA per channel, the motor circuits can drive 600mA per motor).

To use the motor outlets on the gPiO box is relatively simple. On the variables ? In Scratch define a variable motorA (and MotorB if two motors are needed). Set the motor to 0 (zero) for no output and between 1 and 100 to vary the speed of the motor. Depending on the motor you have you will find that a setting of less than 20 will probably not work in that the motor will be very jerky or not turn at all. To make the motor turn in the opposite direction just use -1 to -100.

The motor outlets are the green sockets on the end of the gPiO box. These outlets utilise the same GPIO pins as the normal outputs so you cannot use motors and all of the  normal outputs at the same time. MotorA connects to outputs 11 & 12, motorB connects to 13 & 15. This means that you can use one motor and four digital outputs together or two motors  and two digital outputs.

The motor circuitry is designed to operate the small motors usually found in toys and models, it will not drive larger models. if you try to use motors that are too powerful the circuitry  will shut down to protect itself from overheating. If your motors stop turning after a while you may need to wait for things to cool down.

 

PC / MAC Raspberry Pi Arduino
Scratch
Python
Flowol

Leave a Reply