by Commotion ICT
The Commotion CoCo Control Box (in a metal case, rather than the later plastic variants) is a nice little USB interface box that can be used using Deltronics Python example code with a few small tweaks. Given that the USB “vendor” id is the same on this box as for Deltronics boards, it is probable that this board was designed by Deltronics.
In the internal picture above, a Deltronics sticker can be seen proving their involvement.
Manufacturer | Commotion ICT | |
Model | CoCo Control Box (Metal) | |
Interface | USB (HID) | |
Power | DC Barrel Jack TBC | Centre +ve. Probably best to use 5V (same as newer boxes)? TBC. No manual. Note – found a box with a 2amp 6V supply. |
Digital Inputs | 4 | |
Digital Outputs | 6 | |
Motor Ports | 2 bi-directional | |
Analogue Ports | 4x 5 pin DIN | Not compatible with older Deltronics 5 pin DIN Sensors from Commotion Serial boxes work. |
Voltages | Appears to align with the input supply voltage | |
Extras | Integrated Light and Sound Sensors | These seem to be 8 bit only? |
LEDs show the status of both Digital Inputs and Outputs meaning the interface can be tested with no external hardware. All ports other than the Analogue Inputs are 4mm banana jack sockets.
Setting Up Linux (Including Raspberry Pi) USB Permissions
The following command creates or edits a USB device description as root :
sudo nano /etc/udev/rules.d/86-interfaceboxes.rules
Once the command above is entered, add the following single line (if it is not already there – pay particular attention to the idProduct) :
ATTRS{idVendor}=="139c", ATTRS{idProduct}=="0064", SUBSYSTEMS=="usb", ACTION=="add", MODE=="0666", GROUP="plugdev"
Save by typing ctrl-x, then press “y” to say yes, and then enter to accept the file name.
Finally, run the following command before restarting :
sudo usermod -aG plugdev $USER
Ensuring Libraries are Installed
Run the following two commands to make sure you have the correct USB libraries installed for Python.
sudo apt install python-pip
pip install pyusb
Testing the Interface
Download the following zip folder and uncompress it somewhere convenient :
Open a terminal window and navigate to the folder containing the files. Run “samplemod” by typing the following :
python ./samplemod.py
If you have having difficulties with permissions, try unplugging and plugging the interface back into the computer. If you are still having issues, try running the command above preceded by sudo. Using sudo isn’t ideal but it might help with trouble shooting.
The Code
“samplemod.py” contains the following code :
import controlitmod as ci
import time
# initialize the interface
ci.initialize()
i = 0
direction = 1
while ( True ):
i += direction
# clamp i between 0 and 5
if ( i > 5 ):
i -= 6
if ( i < 0 ):
i += 6
# set all outputs false
ci.clear_outputs()
# set output i on
ci.set_output( i, True )
# reverse direction is input 0 is connected
if ( ci.get_input( 0 ) ):
direction = -1
else:
direction = 1
# sleep for 1/100 second
time.sleep( 0.01 )
When writing your own software it is important to “import controlitmod as ci” although you can use “as spaceships” or anything else you like to create a local name for the library. There after, you can use commands from within the controlitmod library in the format spaceships.initialize() or ci.initialize(). Before doing anything else, you will need to initialise the box / connection.
The library is a very slightly modified version of Deltronics’ Raspberry Pi library for their boxes, adjusted so that it recognises the CoCo box, and to fix a difference with the light and sound sensors. The light and sound sensors can be accessed with the commands ci.get_light_data() and ci.get_sound_data() respectively. They appear to be 8 bit values. The original Deltronics software is available via the Internet Archive’s Wayback Machine from 2017 before Deltronics vanished from the internet.
The original Deltronics documentation has been provided in PDF format and remains applicable for the most part, although take care as I have renamed the library to controlitmod.py from the original controlit.py.
Here is a CoCo box measuring an external LDR and the result being displayed by a Python script :