Want to make pretty lights but don’t have any programming experience? No problem. You can use this quick-start guide to get up and running in no time if you’re using Microsoft Windows 7 or above. First thing to do is to install Python on your computer. To do that, you need to navigate to https://python.org.
Then browse to the bottom of the page and look at the Download Section:
You will want to download the 2.7 version of Python. The Led_Exec program is written in 2.7, and is not supported on 3.6. There are various reasons this is so, but there is not enough space in this quick start to go through them. You’ll just need to play along. Once you click on the 2.7.x (x currently is 13, but can change when a new stable version is released) you will get a page that allows you to select the various download options. You will want to select one of the options to download. Here, you need to know if your computer is 32-bit or 64-bit, because Python is supported on both. In order to find out what your computer has, you need to get to the “System” page. There are several ways to do this in Windows, an easy way is to right-click the Computer icon in the Start Menu and select “Properties” from the drop-down menu. Once you get the properties page, you can see what version OS you have and how many bits wide it is. In my case, it is 64-bit.
Now that you know what OS you have, you can select from one of the options on the downloads page. For 32-bit systems, select the “Windows x86 MSI Installer”. For 64-bit systems, select the “Windows x86-64 MSI Installer”. Now, there is a warning about Itanium processors not being supported, but seriously? If you have an Itanium processor shouldn’t you already know what Python is?
Now that you’ve downloaded the file, simply double-click on the file to start the installer. You’ll be accepting the defaults for the most part. There is of course the first annoying screen from Microsoft telling you that files from the Internet can harm your computer. This shows up because the Python developers have chosen not to pay Microsoft the money they ask for to remove this splash screen. But don’t worry, Python is very safe to install, so just click Run.
It will ask you if you want to install for all users, your choice here, I just accept the default ‘all users’. Even if other users have access to Python on your computer, they’re unlikely to be able to use it to hack the Pentagon or the NSA. Okay, now we’re both on a list…
It will ask you to select the install directory, by default is is C:\Python27. Please just accept the default, or accept the consequences when every package you subsequently install needs to be told which directory you can find the Python binaries in. If you’re reading this quick start guide, you really should accept the default. Remember I warned you….
Now the tricky one. You’ll get a screen asking for various install options, and all of them will be checked, except the last one, the most important one, and one that is currently hidden. This is the all-important “Add python.exe to Path”, which means that the installer will tell the computer exactly where to find Python. If you don’t do this, then Python (and Led_Exec) will not run unless you specify the absolute path to the executable python binary. This can be a real pain if you accept the default, so you need to click the red X option and select the little gray disk option. I cannot think of any reason NOT to do this, so it is the one annoying thing about the installer, especially for the inexperienced user. In the picture below I’ve scrolled down in the setup dialog window to show the default setting, which is the red check mark next to the selection:
Path option is now correctly selected:
When you click next, you’ll get the screen showing you the install progress:
Finished! Now you can exit the installer:
Now the big question is whether or not the install was done correctly. To check this, first launch a command prompt window. You can find it under Accessories, or you can just type ‘cmd’ in the search window and then click on cmd.exe. A command prompt window will open, and then you simply type “python” and hit Enter. If you’ve done everything correctly, then you will see some text telling you what version of Python is running, some simple help commands, followed by the Python default prompt “>>>”.
You’re not quite done yet with the command prompt window, so bear with me and leave it open. You need to install a python package called “pyserial”; this package allows Python the libraries it needs to operate the serial cable interface to the PixelDrive board. This can be done quite easily with the “pip” (python installer program) that is installed when you installed Python. Why is pyserial not already installed? Because there are tens of thousands of Python packages available, and if every one was installed, the installer would be huge and take a large amount of disk space, not to mention a lot of time. The developers of Python leave it to the individual to decide on those packages that they need, and only those. So, first exit Python (in that command window that you still have open with the three arrow prompt “>>>”, by typing “quit()” and hitting Enter. Now you should be back to your normal Windows prompt, and at that prompt you will type “pip install pyserial” and hit Enter. You should see the information in the image below, as pip goes out and collects the packages it needs and installs them. You should see a message that indicates you have successfully installed pyserial and then you will be returned to the Windows prompt.
Go ahead and close that command window by typing “exit” and hitting Enter. Next thing you want to do is to install that USB-Serial cable that came with your development kit. Plug it into an unused USB port and you will get the hardware installation window.
It will automatically locate the drivers for the cable (they come natively with Windows 7 and above) and install them. Note that when the installation completes it will tell you what COM port has been assigned to your cable. It is very important you remember or write this number down, as you will need it in a following step. Note also that if you plug that same USB-Serial cable into another USB port on your same computer, it will install drivers yet again and/or assign a different COM port to the cable. Figuring out which COM port is assigned to the cable is outside the scope of this quick start guide, but there are many methods that are easy to find online. My computer assigned COM 3 to my cable.
Okay! so far so good! Now you can connect up your PixelDrive board to the power supply, the LED string, and the Serial cable with the clips up. Your LED string should now be blinking in the factory pattern that exercises all the various base color combinations available on the RGB LEDs.
Next, unzip the led_exec files that you received with the development kit. The default directory is C:\Pixel, and you should accept this as all SW updates will be targeted for that directory. Once unzipped, you will want to create a batch file to launch the python executable for led-exec. To do this, simply right-click within the directory and select “New”, “txt file”. This will create an empty text file that you will rename to launch.bat. Windows will complain about changing the file extension:
This is okay, because you are creating a Windows batch file, which is just a way of automatically executing a number of commands by clicking a single icon. To edit the file, simple right-click on the file in the Windows Explorer window, and select “Edit” from the menu. The file will open in Notepad or whatever your default editor is. You can enter the text below:
Once you create the batch file, then simply double-click on it to launch the led_exec software!