If you have purchased the Smart-Fx base, everything is ready to use. All you need to do is connect the motors and lights used on the model. See Connections later in this page. Programming the Smart-Fx is covered in detail in the Script Files section. Insert batteries or attach the mains power supply adaptor. Switch the Smart-Fx on. After a short pause you should hear a confirmation sound:
Adjust the volume control if you do not hear this. Press the start button to start the demonstration effects.
The power supply may be battery or mains “power brick”. 6 to 12 volts DC. Connect to the screw terminals on the Smart-Fx controller. Polarity is as shown in the picture below.
Connect the right speaker to the two pins marked “SPK R” on the connection block. Connect the left speaker to the pins marked “SPK L”. It does not matter which way around you connect the individual speaker wires.
Connect the start button to the two pins marked “SWT” on the connection block. It does not matter which way around you connect the individual wires.
There are channel connections for LED lights and 2 for motors. LEDs can also be connected to the Motor channels.
The Micro SD Card
The Micro SD Card works in the Smart-Fx controller when formatted as FAT, FAT16 or FAT32. Use the supplied Micro SD Card to get started. Insert the card into the Smart-Fx controller. the card protrudes slightly from the card slot. The following table describes the files Smart-Fx uses on the Micro SD Card:
|Mandatory||This is the sound file that is played on the speakers when the start button is pressed.|
|motor1.txt||Optional||The script for motor 1|
|motor2.txt||Optional||The script for motor 2|
|light1.txt||Optional||The script for led 1|
|light2.txt||Optional||The script for led 2|
|light3.txt||Optional||The script for led 3|
|light4.txt||Optional||The script for led 4|
|light5.txt||Optional||The script for led 5|
|light6.txt||Optional||The script for led 6|
|config.txt||Optional||Optional configuration settings (volume, repeat, etc.)|
|LoadGood.mp3||Optional||Sound played if all scripts loaded OK|
|LoadErr.mp3||Optional||Sound played if an error is found in one of the scripts|
This file is optional but it is recommended you have it. Config.txt contains 6 numbers (parameters) that define the operation of the Smart-Fx. All the parameters must be present in the file. The parameters are:
|Left Volume||0 – 254||200||The higher the number the louder the noise. Values set to >254 will be set to 254.|
|Right Volume||0 – 254||200|
|Repeat Count||0 – 65534||1||A count that determines how many times the whole sound/script will be played every time you push the start button.|
|Source Voltage||0 – 30000||30000||Specified in millivolts so a value of 9500 represents 9.5 Volts. It specifies the supply voltage being fed to the Smart-Fx. This is used to calculate the maximum voltage for the two motor channels. Although the range of this parameter implies that you are able to supply up to 30V to the Smart-Fx you are strongly advised to limit the supply to the 6-12 Volt range mentioned above.|
|Max Motor1 Voltage||0 – 30000||¼ Source Voltage||Specified in millivolts so a value of 5000 represents 5 Volts. It specifies the maximum voltage that may be supplied to the Motor output. A value greater than the Source Voltage will be set to the Source Voltage.|
|Max Motor2 Voltage||0 – 30000||¼ Source Voltage|
The 2 motor channels scripted in Motor1.txt and Motor2.txt have a variable voltage output. Setting the Source Voltage and Max Motor Voltage parameters in the Config file allows the voltage to vary correctly between 0% and 100% where 100% represents the motor’s maximum voltage. The following example Config.txt shows how this works for a 12V Supply Voltage and 1.5V and 3V motors.
/ Each line must begin either with a comment character (as this one does) or a
/ number (which may be followed by a comment if required).
220 / Left Volume.
220 / Right Volume.
1 / Repeat Count.
12000 / Source Voltage (mV). Example assumes Smart-Fx is connected to a 12V supply
3000 / Max Motor1 Voltage (mV). Example assumes motor1 output is connected to a 3V motor.
1500 / Max Motor2 Voltage (mV). Example assumes motor1 output is connected to a 1.5V motor.
The channel script files are simple text files and can be created using any text editor like Notepad. They consist of a series of 1-character commands followed by numbers, one command per line. The commands and numbers are separated by spaces. The commands may be entered in upper or lower case and the lines may begin with spaces or tab characters. You may also use a / character to insert comments.
The available commands are shown in the table below. numeric values are shown between angle brackets e.g. <value> . A <period> parameter is always measured in centiseconds (1/100 ths of a second) so a value of 234 represents 234 hundredths of a second (or 2.34 seconds). The maximum value allowed is 65534 which is nearly 11 minutes.
|Off||O <period>||Switches the channel OFF for the period specified (0 to 65534)|
|On||N <period>||Switches the channel ON for <period> (0 to 65534)|
|Explode||E <period>||Randomly flashes the channel for <period> (0 to 65534)|
|Set||S <value> <period>||Sets a motor channel to <value> (0 to 100) for <period> (0 to 65534)|
|Ramp||R <start> <end> <period>||Ramp the motor channel from <start> (0 to 100) to <end> (0 to 100) over <period> (0 to 65534). If <start> is less than <end> then the output will ramp up, otherwise it will ramp down|
|Restart||Q||Restarts the script from the beginning if the MP3 is still playing. If the MP3 has stopped playing then the script moves on to the next command (or finishes)|
|Loop||L <count>||Marks the beginning of a loop and defines how many times that loop will be performed. This command works with the ExitLoop command.
Values for <count> are:
0 – Loop if the MP3 is still playing
1-255 – Loop this number of times.
Loops cannot be nested (loops within loops).
|ExitLoop||X||Causes the script to jump back to the command following the most recent Loop command if the loop counter has not exhausted|
When power is applied to the Smart-Fx, the SD card is scanned. The scripts are compiled. If all goes well, the LoadGood.mp3 file will play over the speaker. If any of the scripts has an error, the LoadErr.mp3 file will play. LoadGood.mp3 and LoadErr.mp3 are optional, you may remove them but you will not get feedback on the status of the script compile.
Once the scripts have loaded Smart-Fx waits for the start button to be pressed. The Sound file starts playing and the script runs as soon as the start button is pressed. The script runs until the sound comes to an end or repeats for a set number of times (see config description.) If the start button is pressed while the sound is playing, it will stop and Smart-Fx will be ready to start again.
Programming the Smart-Fx
The programming in the Smart-Fx allows you to match the operation of the lights and motors to a soundtrack. When the start button is pressed, the Smart-Fx plays the soundtrack and runs the scripts which are instructions to operate the motors and lights in a specific way.
To change the programming of the Smart-Fx, you need to remove the Micro-SD card and place it in a reader on your computer. On a Windows PC, the contents of the Micro-SD card will look something like this:
Double-click on any of the script files, light1.txt, light2.txt .. motor1.txt etc. to open them in an editor. Opening light1.txt will look like this:
This is the script that controls light 1. This is what it means:
N 1 Turn the light on for 1/100 second.
O 10 Turn the light off for 1/10 second
N 1 Turn the light on for 1/100 second
O 50 Turn the light Off for 50/100 second (half a second)
Q Repeat from the start
This has the effect of a strobing light with two short flashes followed by a longer pause and repeats.
To change the behaviour of light 1, simply change the script. For example, edit the file so it looks like:
The ‘o 50’ line is changed to ‘o 200’. This will lengthen the delay between the flashes. Save the file back to the Micro-SD card and eject the card from the PC. Be careful to do this properly to make sure any changes to the card are saved. Reinsert the Micro-SD card into Smart-Fx. If the script is ok, you will hear the LoadGood sound again. Press the Start button and observe the changed sequence on light 1.