A hands-on guide to the XIAO RP2040 (the chip on the QPAD) for the HTMAA embedded programming group assignment. You'll upload tiny programs, then use a multimeter and an oscilloscope to see what the pins are actually doing.
A microcontroller pin is a wire whose voltage your code can set or read. The XIAO has 14 of them around its edge. The colored labels tell you which names a pin goes by and what extra jobs it can do.
Pin(26).On the front there are two small buttons: B (boot, hold it while plugging in USB to load new firmware) and R (reset, restarts your program). The pads on the back (SWDIO, SWCLK) are for advanced debugging; ignore them for now.
One pin can have several jobs, but only one at a time. If the QPAD's screen is using D4 and D5 for I2C, don't also use them to blink.
Electronics is full of acronyms. These are the ones that show up this week, in plain terms.
analogRead gives 0–1023. In MicroPython, read_u16 gives 0–65535.setup() that runs once and a loop() that repeats forever, then click Upload. A program is called a sketch.Everything you do with a pin falls into one of four kinds. The first two set a pin; the last two read one.
digitalWriteSets the pin to 3.3 V or 0 V. Turns on LEDs, buzzers, relays.
Meter: 3.3 V or 0 V. Scope: a flat line that jumps.
analogWrite (PWM)Switches on and off very fast. Dims LEDs, sets motor speed.
Meter: the average, like 0.8 V. Scope: full-height pulses of varying width.
digitalReadReads whether the pin is HIGH or LOW. Buttons, switches, touch.
Meter: 3.3 V, dropping to 0 V when pressed.
analogReadMeasures any voltage between 0 and 3.3 V. Knobs, light sensors. Only A0–A3.
Meter and your code agree on the voltage.
There's a fifth kind you'll see on the QPAD: bytes. I2C, UART and SPI send numbers and text as fast streams of bits. You don't need to decode them this week; just recognize them on the scope as bursts of pulses.
For checking solder joints, unplug the board and use the beep setting: touch two points, and a beep means they're connected.
Pick an experiment. The board shows where each probe goes, the meter and scope show what you should see, and the steps below give the code. Uploading new code replaces whatever was on the board, so reflash the QPAD example afterward.