Slide Potentiometer
Overview
The slide potentiometer module can adjust resistance by sliding the handle, outputting analog signals, suitable for applications requiring resistance adjustment.
Technical Specifications
Operating voltage: VCC 3.3V -5V
Module dimensions: 24*48mm
Mounting: 2 plastic building block compatible through-holes
Data type: Analog value
Pin Definition
Pin |
Definition |
|---|---|
GND |
Ground |
VCC |
Power |
AO |
Analog output |
NC |
Not connected |
Example Code
Slide the handle to adjust resistance and view the output analog signal
from lv_gui import *
gui = GUI()
from mpython import *
import math
p0 = MPythonPin(0, PinMode.ANALOG)
import time
while True:
gui.fill(type=0)
gui.draw_label(text=str(p0.read_analog()), row=1, color=0xffffff, wrap=False)
gui.update()
time.sleep(1)