Update testaukset.py

This commit is contained in:
2026-01-08 09:11:46 +00:00
parent 4e38a079b3
commit be8b909377

View File

@@ -4,6 +4,13 @@ from grove.gpio import GPIO
led = GPIO(5, GPIO.OUT) led = GPIO(5, GPIO.OUT)
button = GPIO(6, GPIO.IN) button = GPIO(6, GPIO.IN)
# create PWM instance
pwm = GPIO.PWM(12, 10) # pin 12
pwm.start(0)
# 1000 Hz sound
pwm.ChangeFrequency(1000)
pwm.ChangeDutyCycle(100)
while True: while True:
if button.read(): if button.read():
led.write(1) led.write(1)