Simple BASIC example

Status
Not open for further replies.

Nigel Goodwin

Super Moderator
Most Helpful Member
I've mentioned a few times that I wrote a simple BASIC compiler as part of WinPicProg, and while I was looking for some assembly code for another thread (16F1827 - clearing GPR's), I came across a practical example.

Fairly 'famously' at Matlock Bath (near where I work) they do yearly Illuminations, including rowing boats on the river - these are decorated extensively, pirate ships, space ships. all kinds of things, and a large part of it is the lighting, flashing, sequencing etc. Generally it was done using those old motor driver cams with micro-switches.

Anyway, a guy at work used to enter, and he asked if I could build him something 'better' to control his lights - so I built a simple PIC16F628 feeding 8 driver transistors with open collectors, which switched bulbs fed from the 12V car battery used for power.

Then as at the time I was playing with my BASIC compiler, I wrote the code using that, rather than bothering with assembler.

This code is actually the second version, from 2005, the first was from 2003, the only difference was in the number of steps and sequencing to match his requirements for that years model.

As is obvious, it took VERY little time to write, and it's VERY simple to modify to meet his requirements each year.

 
If anyone would like to try Basic on PIC microcontrollers, allow me to recommend Swordfish Basic. It runs on PIC18F series micros and compiles fast, efficient code. It's similar to using Visual Basic 6.

Swordfish SE (Special Edition) is the free trial version with such generous limits that many people never upgrade to the paid version.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…