View Categories

Mengkontrol LED Dengan Potensio Di Pi Pico

Persiapan Bahan #

– Raspberry Pi Pico / Pico W
– Potentiometer
– Breadboard
– LED
– Resistor 220-Ohm
– Kabel Jumper Male to Male
– Kabel Micro USD
– Aplikasi Thonny IDE

Wiring LED & Potentiometer Di Raspberry Pi Pico #

Sample Code #

#Include the library files
from machine import ADC, Pin,PWM
from time import sleep

led = PWM(Pin(2))#Include the LED pin
potentiometer = ADC(28)#Include the potentiometer pin
led.freq(1000)#Set the frequency

while True:
    value = potentiometer.read_u16()#Get the values
    print(value)#Print value on the shell
    led.duty_u16(value)#Turn the LED ON and OFF
    sleep(0.2)#Set the delay time
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare
What are you looking for in Partdo?
× How can I help you?