Week 4 · Session 2
Your code is about to control a physical object for the first time.
from machine import Pin gives you the tool for controlling any pinled = Pin("LED", Pin.OUT): "LED" is the name MicroPython gives this pin, spelled exactly that way, and Pin.OUT means your code controls itled.on() sends 3.3V through the pin. led.off() drops it back to 0Vimport time, then time.sleep(0.5) pauses your program for half a secondled.on(), time.sleep(0.5), led.off(), time.sleep(0.5) is a complete, visible blinkThis runs right here: the same if/else as Session 1, standing in for the real thing.
led_state to False and run againprint(...) becomes led.on() and led.off()Install Now
This is the only new thing to install. MicroPython is already on your board.
paulober.pico-w-go)Do This Now
MicroPico works inside a folder, so open the one you made in Week 2 before anything else.
cmpsc100Do This Now
activities, choose New File, and name it led_test.pyfrom machine import Pinled = Pin("LED", Pin.OUT)led.on()Do This Now
Session 3
The usual 2:30 lab is the Alumni Panel this week (mandatory). Lab 2 posts Friday morning instead.
or, which Monday covers