Home > other >  In the realtek RTL8722 run MicroPython on single chip microcomputer, three methods simple control GP
In the realtek RTL8722 run MicroPython on single chip microcomputer, three methods simple control GP

Time:02-23

Realtek RTL8722DM microcontroller development board now support through MicroPython running Python code, can be used by the REPL MicroPython Python GPIO control and other peripherals.

material preparing
RTL8722DM x 1, LED x 1, resistance (220 ohms) x 1

examples
Flashing LED are beginning to understand and use MicroPython best example,
First of all, as shown in the figure below will PB_22 pin connected to with the current limiting resistor in series with the LED anode pin, then connect the GND LED cathode pin:


Then, copy the code below and press Ctrl + E to enter in the REPL interface REPL paste mode, if you use Tera Term, simply right-click on the end of any space below the code can be pasted into the REPL, execute the code, then press Ctrl + D if everything is normal, you can see the LED flashes 3 times within 3 seconds,
 
From the machine import Pin
A=Pin (" PB_22 ", Pin OUT)
Dr. Alue (1)
Time. Sleep_ms (500)
Dr. Alue (0)
Time. Sleep_ms (500)
A.o n ()
Time. Sleep_ms (500)
A.o ff ()
Time. Sleep_ms (500)
A.t oggle ()
Time. Sleep_ms (500)
A.t oggle ()
  • Related