the python file takes the "speed" value from the cli. i'll need to set up a sh script that then passes the value to the python file but how would i set up a dimmer switch that would pass the value to the bash script in the first place ?
Code: Select all
import RPi.GPIO as IO
import time
import sys
arg1 = sys.argv[1]
print (arg1)
arg1 = float(arg1)
IO.setwarnings(False)
IO.setmode (IO.BCM)
IO.setup(18,IO.OUT)
p = IO.PWM(18,100)
p.start(arg1)