Programming

The Programming Language

Picaxe is a system, including chips pre-programmed with boot-loaders, project boards designed for in-circuit programming, and download cables. There is also a programming language/environment where programs can be written in Picaxe Basic and downloaded to the chip by clicking on a button.

Programs can also be created using on-screen flowcharts, but I have not tried that.

The software and its documentation, and indeed all the extensive documentation on every aspect of the Picaxe system, are available for free download from the Picaxe website. And no, I don't have shares in the company!

It is helpful to understand what Picaxe Basic is not. If you need event-driven programs, multi-tasking, or much use of interrupts, then Picaxe Basic is not the tool for the job. But for a straightforward sequential control task it is excellent, as well as being quick and easy to use. I relied on it over many years for teaching basic control concepts.

The requirement here is quite straightforward. The program waits for a draught to appear, then it checks the colour, starts the conveyor belt and operates the motor that pushes the draft onto the belt. Next, the program monitors pulses from the conveyor microswitch and when the draught is in the correct position it operates the appropriate motor to push the draught off. Then it goes back to looking for the next draught.

In Picaxe Basic, as in most other programming languages, it is possible to write clear, structured programs and it is equally possible to write impenetrable spaghetti code. Structured programming is a skill and an attitude of mind, not a function of any particular programming language.

Program Listing