GPIO - Blink
Materials
- AmebaD [ AMB23 / AMB21 / AMB22 / BW16 / BW16-TypeC ] x 1
- LED x 1
- Resistor(220ohm) x1
Example
Connect any GPIO pin to the anode leg of the LED which is in series with a current limiting resistor and GND to the cathode of the LED. In this example, we will be using pin “PA_26”.
Code
Then, copy the following code and press Ctrl + e in REPL to enter the paste mode. If you are using Tera Term, simply right click on any blank space of the terminal and paste the code into REPL, then press Ctrl + d to execute the code. If everything is order, you should be able to see the LED blink.
from machine import Pin a = Pin("PA_26", Pin.OUT) a.value(1) time.sleep_ms(500) a.value(0) time.sleep_ms(500) a.on() time.sleep_ms(500) a.off() time.sleep_ms(500) a.toggle() time.sleep_ms(500) a.toggle()
Realtek IoT/Wi-Fi MCU Solutions . All Rights Reserved. Terms of Use