Geodesic Light Dome Code
cmd.c Basic command interpreter
Giving access to the following commands
list list I2C devices on the bus connected to lines P9 and P10 on the Mbed controler
list2 list I2C devices on the bus connected to lines P27 and P28 on the Mbed controler
exec file Run a script file from the local file system
dir Show the files on the local file system
cat file Output the file to the users console
relay number Turn on a relay (range 1 to 8) or 0 turn off all ralays
light channel percentage set a light channel (range 1 to 64) to an output level (range 0 to 100)
wait number wait for number tenths of a second
baud number Set the serial lines baud rate to number
pca number initialise the PCA9685 chip selected by number to a default set of values
ie: pca 0xa0
print string Print a string back to the user
i2c.c All the cotrol sub-routines for the I2C bas and connected devices can be found in this file
main.cpp System initialise code can be found here, also the main program loop is here, Also the systsm exec' a command file from the memory stick called profile.cmd that sets up the default settings of the Mbed board.
pca9685.h The register defines for the PCA9685 are here
scripting.c A simple set of commands used for scripting Very much a work in progress see here for how variable work and look.
set variable number Set a given variable to a number
sum variable function number perform some maths on a vaiable (+,- * / %)
point jX Set a loop point in the code
tst variable function number point test a given variable against a standard maths function (<, >, =, !), if true branch to the point
clr Clear all variables to 0
serial.c Basic subroutines to drive the RS232 channel, this is using the lines P13 and P14 on the Mbed controler
useful.c Some useful subroutines are here
hexview dump a buffer to the console in hex numbers, very useful for debugging
lprintf a variant of printf se the console can be on either the rs232 or the USB serial line
htoi an input convertor to take hex in and pass an int to the code,
Variables in the scripting language

The code currently offers 10 vaiables, labled v0 to v9, and 10 jump points used by the test functions labled j0 to j9. Please note the user script can not jump forward in the scrip, only loop backwards. Lines shorter than 2 charactors, or starting with a '#' charactor will not be exicuted.

Pete Cooper, Jan-March 2010