-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
This issue is only to provide a way to run this on a Raspberry Pi 3+. This may not be added into the source code!
I don't have a Raspberry Pi Pico and I still wanted to be able to try/use this with a normal Raspberry Pi 3+. So I tried to make this code compatible.
Here's how you do it:
Just create a file in your cloned folder named machine.py and paste this code into it:
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
class PWMchanged(GPIO.PWM):
def __init__(self, chan, freq):
super().__init__(chan, freq)
self.start(freq)
def duty(self,dutycycle): self.ChangeDutyCycle(dutycycle/65535)
def freq(self, value): self.ChangeFrequency(value)
def deinit(self): self.stop()
pass
def PWM(pin):
GPIO.setup(pin, GPIO.OUT) # Just to make sure
return PWMchanged(pin, 50)
def Pin(pin):
GPIO.setup(pin, GPIO.OUT)
return pinReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels