Update testaukset.py
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
import time
|
import time
|
||||||
from grove.gpio import GPIO
|
from grove.gpio import GPIO
|
||||||
|
import RPi.GPIO as rGPIO
|
||||||
|
|
||||||
led = GPIO(5, GPIO.OUT)
|
led = GPIO(5, GPIO.OUT)
|
||||||
button = GPIO(6, GPIO.IN)
|
button = GPIO(6, GPIO.IN)
|
||||||
|
|
||||||
# create PWM instance
|
# create PWM instance
|
||||||
pwm = GPIO.PWM(12, 10) # pin 12
|
pwm = rGPIO.PWM(12, 10) # pin 12
|
||||||
pwm.start(0)
|
pwm.start(0)
|
||||||
# 1000 Hz sound
|
# 1000 Hz sound
|
||||||
pwm.ChangeFrequency(1000)
|
pwm.ChangeFrequency(1000)
|
||||||
|
|||||||
Reference in New Issue
Block a user