Home

Computer programming

Chips with everything

Programming has been part of almost every job I have had. Starting at school programming Commodore PETs in Basic, I have continued in Fortran, PC Basic, C, C++, Visual Basic, assembler language for PIC microcontrollers, and Python. I have also programmed Siemens Logo! logic controllers, and recently I've been learning HTML and CSS.

C

By a long way, the bulk of my programming experience is in C. I started during my post-doc at Keele University, writing to code to generate and present the stimuli for colour vision experiments, and for statistical simulations. When I moved to Stirling University, C was my standard language, for generating and presenting stimuli, statistical simulation, simulation of visual processes, and image manipulation. This adds up to about 10 years' experience.

C++

Towards the end of my time at Stirling I picked up a little C++. I used it to write a Windows application which students on my Perception course could use to run experiments for a course project. I was rather pleased that not one of 60 students reported any problems with the program (though I do wonder if they all ignored it and fabricated their results).

Visual Basic

In the last few years I have become familiar with Visual Basic for Excel. I used it during my MSc project to do thermal calculations. At Glasgow Science Centre, I used it to create a system for semi-automatic generation of school itinerary sheets, a program that ran to many hundreds of lines of code. I've since used it for all sorts of sundry programming jobs as the need has arisen.

I wrote Visual Basic code to automatically generate the navigation menus and site map on this website. Before I did this, altering the structure of the site involved adjusting menus on several pages, a piece of error-prone drudgery if ever there was one. Now I lay out the structure of the site on a spreadsheet, and the program generates the code for the menus and the map and inserts it into the source files automatically. I'm sure that web-authoring software handles this sort of thing, but this way I keep control of the HTML, and I like doing things at the nut-and-bolts level anyway.

Python

After being given a book on the subject by my brother for Christmas 2005, I have written a few Python programs. The one I've used the most is my German vocabulary program, which stores my accumulated vocabulary and tests me on it. Each word or phrase is tested less often the more I get it right, and more often the less I get it right. I also used Python to organise a speed demo-dating event.

Assembler language for PIC microcontrollers

At Glasgow Science Centre I introduced myself to the austere beauty of programming PIC microcontrollers in assembler language. I did 4 projects in all, my favourite (and the biggest challenge) being one that used a PIC to implement 4 parallel channels of pulse-width modulation signals to control the brightness of 4 sets of LEDs. This was without using the in-built PWM channels of which there are only 3. The input signals were voltages applied to the ADC inputs of the chip. I did this as part of prototyping an exhibit about colour vision. My second favourite project was one to produce signals to control a stepper motor, for a prototype of another exhibit about colour vision.