The firefly is Oxford Lasers’ high speed imaging diode laser. It was initially designed by Oxford Lasers in 2008, and is still in production today. The laser is controlled via a front panel for which I programmed the user interface. The front panel features a 4-way joystick controller and four buttons. User feedback is via a 128x64 pixel graphical LCD screen.
I decided that a more visual interface than a simple menu structure would be appropriate. I sketched up some designs for how the layout of the display could look and eventually settled on a two-mode format. A ‘run’ mode shows the main laser operating parameters, including all of the important settings like pulse duration and separation. In run mode, the joystick control can be directly used to adjust pulse duration and burst separation.
Pressing the menu button switches to a menu mode where all the settings may be adjusted including the user interface language. The user simply selects the line that they want to change and then presses the joystick in to allow fine control of the individual digits of the value. Pressing the joystick a second time switches back to the menu or pressing the menu button jumps back to the run mode.
The programming was not straight-forward because the LCD refresh takes a full second to complete, so looks visually distracting. To overcome this I wrote individual characters to the screen to overwrite the existing values. The program algorithm is shown below (I can’t share code, sorry).
The coding required that I also modify the character drawing routines to correctly adjust the spacing of letters and numbers for when they were written atomically, and generate custom fonts to allow the interface to be displayed in Japanese kanji. The code is fully adjustable, and it is very easy to adjust the maximum and minimum values of the various settings, and the number of settings in the menu by editing a few constants in the code header and adding the relevant text to the value arrays.