After going through all the install steps for your OS, run these checks as simple tests to make sure everything is installed correctly. Go ahead and plug in your Pico to a USB port on your PC.
Most of these tests are done via the Python REPL, at the >>>
prompt. To get there, simply launch Python:
$ python3 Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
import hid hid.enumerate() 'device' in dir(hid)
The enumerate()
command should dump a listing of everything attached to your USB ports. The last command is a test of the actual hid module imported and should return True
.
import serial.tools.list_ports as lp lp.comports()
You should get a list of available COM ports.
import hid device = hid.device() device.open(0xCAFE, 0x4005)
It should run without any errors:
If for some reason the Pico can not be found, you might see something like this:
Check your USB cable connection and double check that the u2if firmware is loaded.
If you want to continue testing in the same Python session, then make a quick call to close()
to free up the device.
device.close()
Or, just exit the Python session.
import os os.environ["BLINKA_U2IF"]
If you get a KeyError it means you did not set the environment variable right:
If you have set it correctly, you'll get a value back:
Check Blinka is setup correctly
If all of the above checks pass, go ahead and try this as a quick sanity check that basic Blinka functionality is in place. At the Python REPL, type:
import board dir(board)
You should not get any errors and the various pins available on the Pico should be shown.
Page last edited March 08, 2024
Text editor powered by tinymce.