Created
July 23, 2019 14:57
-
-
Save izzuddin91/5b74321674ff21284d77a164db891c24 to your computer and use it in GitHub Desktop.
setting up switch to display information on matrix led
This file contains hidden or 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
import RPi.GPIO as GPIO | |
import time | |
import os | |
import csv | |
GPIO.setmode(GPIO.BCM) | |
#pin bawah skali, seblah ground | |
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP) | |
while True: | |
# with open('/media/usb1/operation_logs.csv', 'rb') as csvfile: | |
# reader = csv.reader(csvfile) | |
# for row in reader: | |
# print(row) | |
input_state = GPIO.input(21) | |
if input_state == False: | |
print("button pressed") | |
# os.system('python /home/pi/Desktop/switch/matrix_led.py') | |
time.sleep(0.2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment