Stuff you need
For this project you will need the following:
- MicroPython Microcontroller with headers soldered on ( or a soldering iron)
- 2 Jumper Leads
- 1 LED
- 1 560 ohm resistor
Step 1 – Wire up your LED and resistor.
The first thing you need to do is wire up your LED and resistor circuit as shown below!
Connecting up the Resistor
Resistors can be connected either way around.
Need help calculating the color code for the resistor? Click here!
Connecting up the LED
Step 2 – Connect your MicroPython Controller to the Computer.
Once your have completed the wiring you now need to plug your MicroPython in to your computer using a micro USB cable. This serves 2 purposes:
- It provides power to the MicroPython
- It gives you access to the Python main.py file that we need to edit.
Step 3 – Open the main.py file and add your code
Your PC should have automatically recognised the MicroPython as a USB device and you should have access to a new drive that should look something like below ( if you are using Windows).
Double click on the drive and then open file main .py in notepad or another editor.
Python Code with Comments
Step 4 – Save your code
Save your changes to the code and then wait until the red light on your MicroPython Turns off – this means it has finished saving!
Step 5 – Reset your MicroPython
Press the reset button and your LED should flash!
- Make sure you have typed ‘Y1’ not ‘y1’ – The capitalisation is important!
- Take care that you wait for the red light to turn off before pressing the reset button!