GPIO - Blink

Materials

  • AmebaD [ AMB23 / AMB21 / AMB22 / BW16 / BW16-TypeC ] x 1
  • LED x 1
  • Resistor(220ohm) x1

Example

Connect pin PA_26 to the anode leg of the LED which is in series with a current limiting resistor and GND to the cathode of the LED.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 for 3 times in 3 seconds.

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_15", 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()
Please confirm that QQ communication software is installed