Created
September 8, 2016 13:20
-
-
Save jezman/0c0dbfeefcda889624d676a1b0289adf to your computer and use it in GitHub Desktop.
RapberryPi lcd + pwm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from time import strftime, sleep | |
import RPi.GPIO as GPIO | |
pwm_pin = 18 | |
GPIO.setwarnings(False) | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(pwm_pin, GPIO.OUT) | |
current_time = strftime('%H') | |
br = GPIO.PWM(pwm_pin, 50) | |
if '07' < current_time < '17': | |
br.ChangeDutyCycle(100) | |
else: | |
br.ChangeDutyCycle(50) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment