-
Notifications
You must be signed in to change notification settings - Fork 4
Testing the pro micro
At the moment, this has only been tested with Python 2.7 - there are know issues we are looking at with some slightly earlier versions of 2.6 (to do with reading the version number of Python), and some known issues with all versions of Python 3 that we are looking at (to do with the way sub packages are imported). Our specific need was for a GPIO attachment for PC/Mac/Linux that worked with Python 2.7, but I will investigate and fix these issues later in 2014.
On Mac, you should just be able to plug the device in once it is programmed, and it hould appear as a serial port. When it pops up a box saying that a keyboard has been found, just close that box by pressing the red X button in the corner.
On windows, you have to install the ProMicro.inf using the instructions in the SparkFun hookup guide above. Note that this is a bit complex on Windows 8.1 due to the new "Driver enforcement mode" of windows, but the hookup guide on the sparkfun site does work if you follow it very carefully.
On linux (I've only tested on Ubunto 12.04LTS), plug it in and it should detect the device the first time you run one of your programs.
Once the device has it's firmware installed and it is plugged in, you are ready to run the test programs. Wire up a LED to pin 15, then run:
python testLED.py
The first time this runs, it will work out the serial port number. It will prompt you to remove the device and press ENTER (at which point it scans your system for serial ports), and then it will prompt you to insert the device and press ENTER (at which point it will re-scan to detect the newly inserted port). We have found this to be the most reliable method on all platforms for detecting a new serial port, compared to opening and testing each port (which can sometimes cause devices to lock up).
You will be shown the name of your serial port, and asked if you want to remember it - always choose Y so that your program will run correctly the next time you run it. It creates a small file called 'portscan.cache' which remembers the serial port number, you can delete this file if your serial port number changes for any reason and you want it to re-scan your system.
Your LED should now be flashing.
Once you have tried that, wire a button up to pin 4 and run:
python testButton.py
If you are getting excited at this point, wire up a 7-segment display to pins 7=a, 6=b, 14=c, 16=d, 10=e, 8=f, 9=g, 15=dp
If your display is Common Anode, edit testSeg7.py and set ON=True If your display is Common Cathode, edit testSeg7.py and set ON=False
Now run this to count through the numbers 0 to 9 on the display:
python testSeg7.py