It looks almost exactly like the description of the REPL a few pages
ago, because it is. You can stick to tradition and type print ("Hello
World") as your first MicroPython program if you want to, but there
are more exciting things in store.
Blinking an LED on the Pico
from machine import Pin
led = Pin(25, Pin.OUT)
led.value(1)
What happened? One of the LEDs on the Pico just lit up! To shut
it off, type into the REPL:
led.value(0)
It’s generally accepted that the ability to control a microcontroller
pin in this way is the foundation of all physical computing. Now that
you’ve got that pin working, the world is yours!
Digression
Did you know that the Chrome browser keeps track of the
devices plugged into your computer? And did you know that
you can get Chrome to tell you which devices are plugged into
your computer? Just type: chrome://device-log/?refresh=30
into the address bar to see what Chrome knows about your
computer. Kind of cool, and kind of creepy.
Appendix B 209
GSW_RASPI_4ED_FIN.indd 209GSW_RASPI_4ED_FIN.indd 209 10/28/21 10:55 AM10/28/21 10:55 AM