コード例 #1
0
import RPI.GPIO as GPIO

GPIO.SETMODE(GPIO.BCM)
GPIO.SETUP(15, GPIO.IN)
GPIO.SETUP(14, GPIO.IN)
a="Sanjay S Nair"
b="Elvis Presley"
if GPIO.input(14):
    print("Finger detected - Sanjay S Nair");
    print("Proceed to face verification");
    face_recognition(a,b);
elif GPIO.input(15):
    print("Finger detected - Your Name");
    print("Proceed to face verification");
    face_recognition(a,b);
else
    print("Finger not found");
    
コード例 #2
0
import RPI.GPIO as GPIO
import time

buzzer_pin = 12

GPIO.setmode(GPIO.BOARD)
GPIO.SETUP(buzzer_pin, GPIO.OUT)

#MAKE BUZZER SOUND
GPIO.output(buzzer_pin, GPIO.HIGH)
time.sleep(0.5)

#stop buzzer sound

GPIO.output(buzzer_pin, GPIO.LOW)

GPIO.cleanup