-
Look at the text in the bottom right-hand corner of the Thonny editor. It will show you the version of Python that is being used.
-
If it does not say ‘MicroPython (Raspberry Pi Pico)’ there, then click on the text and select ‘MicroPython (Raspberry Pi Pico)’ from the options.
-
Use the instructions here to test your Pico W.
-
Now type this code into a new program:
from picozero import pico_temp_sensor
from time import sleep
for _ in range(100):
print(pico_temp_sensor.temp)
sleep(1)
- Click on View -> Plotter in Thonny and you should see the readings from the temperature sensor displayed. Warm up the Pico W with your hands and watch the plot change.
-
Now open this project guide. You can skip to Step 3 ("Getting started with your Raspberry Pi Pico W").
-
Use the password
rocksrocks
to connect to the CDKU wifi network. -
Follow the rest of the guide to create a web-server on your Pico W and use it to take a temperature reading and control the LED.
- Take a look at some of the examples here. You can reproduce the circuits on a breadboard if you wish.
- How about adding an RGB LED and changing the colour using buttons on your web-page?
- Have a look at the examples in the picozero documentation.
- Create a light sensor:
Here is some simple code to take a light reading. Can you display that value on your webpage? How about triggering an LED to light up when it gets dark?
from picozero import Pot
ldr = Pot(26)
print(ldr.value*1000)
Uh oh!
There was an error while loading. Please reload this page.