Hardware Reference
In-Depth Information
If at this stage your computer doesn't seem to recognise the device, go to
the following sparkfun page and work through the instructions in the hookup
guide, which is quite detailed, and also is updated when each new version of
an operating system is released: https://www.sparkfun.com/products/12587. You
might also like to look at SKPang's product page for the ProMicro as he has
more instructions on there to help you out: http://skpang.co.uk/catalog/pro-micro-
33v8mhz-with-headers-and-anyio-irmware-p-1327.html
Finding the.Serial Port Number
The Arduino you have just connected to your computer appears to the computer as a
device called a serial port. I won't go into the details of what that means in this topic,
but you do need to make sure that the anyio package selects the correct port before it
will work as a GPIO extender.
I have written a little utility to do this for you, and it is included in the anyio package.
Figure 5-5 shows a sample session using this utility, so you can see what it should nor-
mally look like.
To make sure the correct port is selected:
1. Open IDLE and click File Open to browse for an existing Python program.
2. Inside the MyAdventures folder, open the file called findPort.py and it will
load into the Python editor window.
3. Run the program by choosing Run Run Module from the menu. You will get
some onscreen instructions.
4. Unplug the USB lead from the Arduino end, then press Enter to start the scan.
This step removes the USB lead from your computer so that the program can
scan all available ports in your computer and build a list of any ports except the
new one you are adding.
5. Next you will be asked to plug in the device so that the program can scan all
available ports in your computer again, and use that to detect which new device
has been added. Plug in your USB lead again, wait a couple of seconds, then press
Enter again.
6. If this has been successful, you should get a message indicating the port name or
number that has been found, and you should be asked if you want to remember
this. Type a Y then press Enter. he findPort.py program (shown in
Figure 5-5) then creates a file called findport.cache that remembers the port
number of your Arduino. When you use any of the GPIO functions later it will be
able to find the Arduino port correctly.
 
Search WWH ::




Custom Search