Sunday, December 25, 2011

More Tiny Basic - the plot thickens

Since finding Tiny Basic for the Arduino yesterday - by the powers of Twitter and being well connected to some very clever programming pals - we now have the digital and analogue input and outputs working - thanks @ceejay for adding this functionality.

So its now possible to flash LEDs from a simple basic program - so there is now temptation to write a Christmas lights chaser routine with a handful of LEDs and a few lines of code.

I have started a Tiny Basic Wiki page for anybody to put up their contributions, updates and improvements.

What I love about an interpreted language like Basic - is that you don't have to go through the edit-recompile-upload process - you can change your code as quick as you can type a new line and type run. This means that it is very quick to change variables, like loop parameters, delays, threshold values - without having to spend 3 minute going through the previous cycle.

This immediacy of changing how your application work with a change to a single line of code is what really appeals - it makes programming a lot more fun. And this could be very important if you are 7 years old with the attention span of a goldfish.

Tiny Basic running on the Nanode or Arduino is proving to be very quick. I think my generation that grew up with 8 bit home computers, had the attitude that Basic was slow - and perhaps it was on a machine clocked at 4MHz or under - where the cpu was doing a lot of other stuff at the same time. This cut down version of Tiny Basic is lightening quick on a 16MHz ATmega328.


I noted a few benchmarks whilst running the serial terminal interface at 115200 baud:

1 million FOR - NEXT loops in 45 seconds
10,000 10 -bit ADC reads and printed in 7 seconds, 4 seconds if you don't print them.

The plan is now to start a Wiki page so that others can contribute to the Tiny Basic project, add new functionality and extend the usefulness.

On the Nanode we now have a rich set of peripherals and interfaces. Making use of the micro SD card as a solid state drive for loading and saving programs is an obvious choice. Some better editing features would make code entry simpler - and of course having interactive coding via a web browser is a goal for the near future.


Happy Christmas




Ken

No comments: