| 8-bit LED bank | Port[7:0] → LED7…LED0 | Write a byte. Each 1 lights its corresponding LED. |
| 8 momentary pushbuttons | Port[7:0] = B7…B0 inputs, active high | Hold a button with the pointer, Space, or Enter. Read its bit; releasing the button clears it. |
| 4 switches + 4 LEDs | Port[7:4] = SW3…SW0 inputs; Port[3:0] = LED3…LED0 outputs | Toggle switches and read the high nibble. Write the low nibble to control the LEDs. |
| RGB LED | Port[5:4] = red; [3:2] = green; [1:0] = blue; [7:6] unused | Write intensity 0–3 for each color channel. |
| 2-digit 7-segment | Port[7:4] = left digit; Port[3:0] = right digit | Write a byte to display two hexadecimal digits, 00–FF. |
| Raw 7-segment digit | Port bits 0–6 = a…g; bit 7 = decimal point | Set individual segment bits to 1 to light them. This common-cathode digit uses a raw segment pattern. |
| 8×8 LED matrix | Port[7] = WR; [6] = pixel; [5:3] = row; [2:0] = column | Set the pixel and coordinates, then pulse WR from 0 to 1 to store one pixel in the 8×8 display. |
| Timer with display | Port[7] = RUN; [6] = RESET; [5:0] = prescaler P | RUN increments the 32-bit count every P+1 CPU cycles. RESET has priority and clears count/phase. Pausing holds them; changing P clears the phase. |
| Ultrasonic distance sensor | Port[7] = TRIG; [6] = READY; [5:0] = distance in cm | Set the simulated distance from 0 to 63 cm (default 20). Pulse TRIG low → high to start a measurement. READY clears during measurement and rises after 2 + distance subsequent CPU cycles; then read bits 5–0. |
| Piezo / buzzer | Port[7] = ON; [6:0] = frequency code | Enable a tone at 100 + 15 × code Hz. Clear ON to silence it. Press Step once to allow browser audio. |
| 8-bit ADC | Port[7:0] = ADC input code | Move VIN from 0 to 5 V. Read round(VIN / 5 × 255), from 0 to 255. |
| 8-bit DAC | Port[7:0] = DAC output code | Write 0–255 to set VOUT = code / 255 × 5 V. |
| 8-channel relay board | Port[7:0] → K7…K0 | Set a bit to energize its relay and connect COM to NO. Clear it to connect COM to NC. |
| PWM output | Port[7] = enable; [6:0] = duty code | One period lasts 127 CPU cycles; duty is code / 127 × 100%. Code 0 stays low and 127 stays high. Disabling resets phase and drives low. |
| Hobby servo motor | Port[7] = enable; [6:0] = position | Enable to map codes 0–127 to 0–180°. Disabling holds the shaft at its last angle. |
| DC motor + H-bridge | Port[7] = enable; [6] = direction; [5:0] = speed | Direction 0 is clockwise, 1 counterclockwise. Enabled speed 0–63 advances 0–12° per CPU cycle. Disabling or speed 0 stops motion. |
| 4-coil stepper motor | Port[3:0] = D, C, B, A coils; [7:4] unused | Send 1, 3, 2, 6, 4, 12, 8, 9 for successive half-steps. Reverse the sequence to reverse motion; 0 releases the coils. |
| 4×4 keypad | Port[7:4] = row outputs; [3:0] = column inputs | Drive one row high, then read the columns while a key is held. Scan each row to identify the key. |
| Rotary encoder + LEDs | Port[7] = A; [6] = B; [5] = PUSH; [4:0] = LED outputs | Drag between 15° detents. Each detent sends a complete A/B cycle on a 400 ms phase timer, independent of the CPU. Use Run at 60 cyc/s to sample changes. Hold the knob for PUSH; bits 4–0 drive the LEDs. |
| 8-bit shift register | Port[3] = DIR (1 output, 0 input bank); [2] = latch/capture; [1] = CLK; [0] = DATA | For output, set DATA before each rising CLK edge, then pulse latch/capture low → high to update the eight outputs. For input, pulse latch/capture to sample the input bank; read its MSB on DATA before each rising CLK edge. |
| 16 × 4-bit memory | Port[7] = R/W; [6] = EN; [5] = ADDR; [4] unused; [3:0] = payload | With ADDR=1, pulse EN low → high to latch an address. With ADDR=0, pulse EN to write (R/W=0) or read (R/W=1). Read data drives bits 3–0 while read EN stays high. |
| 16×2 LCD | Port[7] = BL; [6] = E; [5] = RW; [4] = RS; [3:0] = data | Keep RW=0. Select command/data with RS, send the high nibble then the low nibble, and pulse E high → low for each. |
| SPI flash memory | Port[3] = CS, active low; [2] = CLK; [1] = MOSI output; [0] = MISO input | Select the flash with CS low. Use mode 0, MSB first: sample MISO on rising CLK edges. Send 9F then dummy bytes for ID 7F 32 01. |
| I²C temperature / light sensor | Port[1] = SDA, 0 pulls low / 1 releases; [0] = SCL | Address 0x48 exposes temperature, light, and ID A5. Write a register pointer, then use repeated START to read. Release SDA explicitly for reads and ACK sampling; finish with NACK and STOP. |