Step 7: Install the Python interpreter and program

Picture of Install the Python interpreter and program
NOTE: The Puzzlebox Brainstorms software includes the console-based Python program described in this step. Strictly speaking it should not be necessary to download the Python interpreter or any of the software's dependencies (the Windows version mentioned in Step 8 is pre-compiled and packaged), but it is assumed anyone who wishes to leverage this software for a new type of wheelchair will need to know how to control everything from a source code level, so we have included these details for completeness.

Download and install the Python interpreter and download the Python program, listed in Step Two of this Instructable.

You may have some trouble configuring the program for the correct serial port of your Arduino, especially if your computer already has a serial port.

Make sure the Arduino is plugged in and run the program using the Python interpreter.  If you press direction keys such as i j k m, you will see the built-in LED on the Arduino turn on or off because it is wired (in software) to one of the output lines to the interface board.

At this point you can connect the Arduino to the interface board.  Prop the wheelchair up so its wheels are not touching the ground, or if you can (and we did) disengage the wheel clutches.  This way, when the motors turn, they don't actually cause the wheelchair to move (although it no longer is braked in place and could roll).

If you turn on the wheelchair, the lights should come on normally and indicate that the wheelchair is ready to be moved.  Moving the joystick should cause the brakes to click off and the motors to try to move the chair.

Now that the Python program is running, as in the picture below, pressing one of the movement keys will cause the program to tell the Arduino to send the wheelchair in that direction for a short time, and then tell it to stop. Pressing the 1, 2, or 3 keys will set the program to "speed" 1 2 or 3.  In speed 1, the minor transistor for each direction is activated.  In speed 2, the major transistor (the one with the lessor resistor) is activated.  In speed 3, both transistors (seen as 1 or 0 in the text display below) is activated.

(note that these speeds have nothing to do with speeds selected with the ON/OFF switches of the chair - see step 3)

When the software sets the output to 00110011 the wheelchair is told to stop.

At this point you should test that the Python program properly causes the wheelchair to move when a key is pressed (repeatedly) and the next step is to configure the Puzzlebox Brainstorms and EEG headset software.
Remove these adsRemove these ads by Signing Up