It is 2017 and we have a slew of low cost or free tools available that teach anyone how to program a computer. Just for Windows, we have something called Small Basic, from Microsoft. It is free and has a bunch of material you can use to teach anyone, especially children, how to code. There is also Python, Minecraft and a host of other, modern tools.
So, why use something as crude as Tiny Basic? One that requires a terminal? Well, there are a few reasons you may want to do this.
Cost, for one.
It is free. It runs on Arduino and Arduino clones. You can use it to also teach basic electronics.
And, that is what I am doing…using it to teach not only programming, but also how computers work. It is really more for the latter as Small Basic cannot manipulate sensors and other hardware like Tiny Basic can. Since Tiny Basic includes instructions for reading temperature sensors and a real time clock, it is perfect for teaching things like turning on something on if the temperature gets above a given number or it if is 5 o’clock, turn off something.
I recently started doing this with my step son. We used Embedded Tiny Basic on my ‘portable’ lab, which contains an Arduino UNO clone, a 2 x 16 LCD, breadboard and voltmeter. We first made one green LED blink, then added a second, red LED blink. I used Tiny Basic to explain how to talk to the LED’s and used the DELAY instruction to make the LED’s blink at a constant interval. I also took the opportunity to teach him binary. We had discussed it previously, but I don’t think he really got it. Until now. Using the DWRITE statement, which takes two parameters…pin number and a zero for off or 1 for on. Having him use that code got him to understand the concept. Small steps.
His mind is wandering now…’I can build a robot…a game…something to tell me when Xander is coming down the hall…’ Xander is his four year old brother.
There are those of you out there who are thinking that this is a terrible idea, using Tiny Basic, that is. Well, no, not really. He is getting real instruction with a more object oriented and modern language while using Tiny Basic to learn the nitty gritty of the hardware. You do not need a modern, object oriented language to blink an LED.
I will post future updates on our progress as well as sample code. Below is the code we used to blink the LED’s.
100 PRINT “INTERVAL”;: INPUT I
110 FOR X=1 TO 50
120 DWRITE 3, 1
130 DELAY I
140 DWRITE 3,0
150 DELAY I
160 NEXT X
(For single LED-it was on digital pin 3)