TCS Pune

Pico: MicroPython GPIO

Practical lesson

Pico: MicroPython GPIO

Start RP2040 development with MicroPython and a simple output loop.

◷ 25 min

Parts and tools

  • Raspberry Pi Pico
  • USB cable
  • Thonny IDE

Lesson

Learning objective

Start RP2040 development with MicroPython and a simple output loop.

Procedure

  1. Review the circuit and confirm the board voltage.
  2. Build and inspect the wiring before applying power.
  3. Upload the example, observe the result and record your readings.
  4. Change one parameter, predict the result and test again.

Troubleshooting

Check power, ground, pin selection, polarity, compiler target and serial output. Use a multimeter or logic analyser where appropriate.

Example code

from machine import Pin
from time import sleep
led=Pin("LED",Pin.OUT)
while True:
    led.toggle(); sleep(0.5)

Knowledge check

Which language is used in this example?

Ready when you are

Need help with your laptop or computer?

Send us the model and fault details. Start your repair request online or contact TCS Pune directly.

WA