Home > other >  MicroPython microcontroller - 3 lines of code easily read ADC values
MicroPython microcontroller - 3 lines of code easily read ADC values

Time:01-12

MicroPython has official transplant to realtek RTL8722 dual-band WiFi + 5.0 BLE single-chip microcomputer, thus carry out the tasks of an ADC from the beginning to the end only need 3 lines of Python code can easily fix, the following is sample.

Prepare the material: RTL8722 x 1, potentiometer x 1

Connects RTL8722 to read its numerical a potentiometer, the connection way below


After connect, copy and paste the following code to the REPL, ADC values can directly read out, simple and convenient

From the machine import ADC
A=ADC (0)
A.r ead ()
  • Related