-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,837 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import RPi.GPIO as GPIO | ||
import time | ||
GPIO.setwarnings(False) | ||
switch1=35 | ||
switch2=37 | ||
motor1=38 | ||
motor2=40 | ||
GPIO.setmode(GPIO.BOARD) | ||
GPIO.setup(switch1,GPIO.IN,GPIO.PUD_UP) | ||
GPIO.setup(switch2,GPIO.IN,GPIO.PUD_UP) | ||
GPIO.setup(motor1,GPIO.OUT) | ||
GPIO.setup(motor2,GPIO.OUT) | ||
while 1: | ||
if GPIO.input(switch1)==0: | ||
GPIO.output(motor1,GPIO.HIGH) | ||
GPIO.output(motor2,GPIO.LOW) | ||
print("Clockwise") | ||
time.sleep(2) | ||
GPIO.input(switch2)==0 | ||
GPIO.output(motor1,GPIO.LOW) | ||
GPIO.output(motor2,GPIO.HIGH) | ||
print("Anti-Clock wise") | ||
time.sleep(2) | ||
|
||
GPIO.output(motor1,GPIO.LOW) | ||
GPIO.output(motor2,GPIO.LOW) | ||
print("stop") | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import RPi.GPIO as GPIO | ||
|
||
import time | ||
GPIO.set warnings(False) | ||
|
||
switch1 = 35 | ||
|
||
switch2 = 37 | ||
|
||
motor1 = 38 | ||
|
||
motor2 = 40 | ||
|
||
GPIO.setMode (GPIO.BOARD) | ||
|
||
GPIO.setup(switch1, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(switch2, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(motor1, GPIO.OUT) | ||
|
||
GPIO.setup(motor2, GPIO.OUT) | ||
|
||
|
||
while 1: | ||
|
||
if GPIO.INPUT(switch1==0): | ||
|
||
GPIO.output(motor1, GPIO.HIGH) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("clockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.HIGH) | ||
|
||
print("anticlockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("sleep /n") | ||
|
||
|
||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
import RPi.GPIO as GPIO | ||
|
||
import time | ||
|
||
GPIO.set warnings(False) | ||
|
||
switch1 = 35 | ||
|
||
switch2 = 37 | ||
|
||
motor1 = 38 | ||
|
||
motor2 = 40 | ||
|
||
GPIO.setMode (GPIO.BOARD) | ||
|
||
GPIO.setup(switch1, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(switch2, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(motor1, GPIO.OUT) | ||
|
||
GPIO.setup(motor2, GPIO.OUT) | ||
|
||
|
||
while 1: | ||
|
||
if GPIO.INPUT(switch1==0): | ||
|
||
GPIO.output(motor1, GPIO.HIGH) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("clockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.HIGH) | ||
|
||
print("anticlockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("sleep /n") | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import RPi.GPIO as GPIO | ||
import time | ||
GPIO.setwarnings(False) | ||
switch1=35 | ||
switch2=37 | ||
motor1=38 | ||
motor2=40 | ||
GPIO.setmode(GPIO.BOARD) | ||
GPIO.setup(switch1,GPIO.IN,GPIO.PUD_UP) | ||
GPIO.setup(switch2,GPIO.IN,GPIO.PUD_UP) | ||
GPIO.setup(motor1,GPIO.OUT) | ||
GPIO.setup(motor2,GPIO.OUT) | ||
while 1: | ||
if GPIO.input(switch1)==0: | ||
GPIO.output(motor1,GPIO.HIGH) | ||
GPIO.output(motor2,GPIO.LOW) | ||
print("Clockwise") | ||
time.sleep(2) | ||
GPIO.input(switch2)==0 | ||
GPIO.output(motor1,GPIO.LOW) | ||
GPIO.output(motor2,GPIO.HIGH) | ||
print("Anti-Clock wise") | ||
time.sleep(2) | ||
|
||
GPIO.output(motor1,GPIO.LOW) | ||
GPIO.output(motor2,GPIO.LOW) | ||
print("stop") | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import RPi.GPIO as GPIO | ||
|
||
import time | ||
GPIO.set warnings(False) | ||
|
||
switch1 = 35 | ||
|
||
switch2 = 37 | ||
|
||
motor1 = 38 | ||
|
||
motor2 = 40 | ||
|
||
GPIO.setMode (GPIO.BOARD) | ||
|
||
GPIO.setup(switch1, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(switch2, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(motor1, GPIO.OUT) | ||
|
||
GPIO.setup(motor2, GPIO.OUT) | ||
|
||
|
||
while 1: | ||
|
||
if GPIO.INPUT(switch1==0): | ||
|
||
GPIO.output(motor1, GPIO.HIGH) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("clockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.HIGH) | ||
|
||
print("anticlockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("sleep /n") | ||
|
||
|
||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
import RPi.GPIO as GPIO | ||
|
||
import time | ||
|
||
GPIO.set warnings(False) | ||
|
||
switch1 = 35 | ||
|
||
switch2 = 37 | ||
|
||
motor1 = 38 | ||
|
||
motor2 = 40 | ||
|
||
GPIO.setMode (GPIO.BOARD) | ||
|
||
GPIO.setup(switch1, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(switch2, GPIO.IN, GPIO.PUD_UP) | ||
|
||
GPIO.setup(motor1, GPIO.OUT) | ||
|
||
GPIO.setup(motor2, GPIO.OUT) | ||
|
||
|
||
while 1: | ||
|
||
if GPIO.INPUT(switch1==0): | ||
|
||
GPIO.output(motor1, GPIO.HIGH) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("clockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.HIGH) | ||
|
||
print("anticlockwise /n") | ||
|
||
time.sleep(2) | ||
|
||
if GPIO.INPUT(switch2 == 0): | ||
|
||
GPIO.OUTPUT(motor1, GPIO.LOW) | ||
|
||
GPIO.output(motor2, GPIO.LOW) | ||
|
||
print("sleep /n") | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
PyFingerprint | ||
Copyright (C) 2015 Bastian Raschke <[email protected]> | ||
All rights reserved. | ||
""" | ||
|
||
from pyfingerprint.pyfingerprint import PyFingerprint | ||
|
||
|
||
## Deletes a finger from sensor | ||
## | ||
|
||
|
||
## Tries to initialize the sensor | ||
try: | ||
f = PyFingerprint('/dev/ttyS0', 57600, 0xFFFFFFFF, 0x00000000) | ||
|
||
if ( f.verifyPassword() == False ): | ||
raise ValueError('The given fingerprint sensor password is wrong!') | ||
|
||
except Exception as e: | ||
print('The fingerprint sensor could not be initialized!') | ||
print('Exception message: ' + str(e)) | ||
exit(1) | ||
|
||
## Gets some sensor information | ||
print('Currently used templates: ' + str(f.getTemplateCount()) +'/'+ str(f.getStorageCapacity())) | ||
|
||
## Tries to delete the template of the finger | ||
try: | ||
positionNumber = input('Please enter the template position you want to delete: ') | ||
positionNumber = int(positionNumber) | ||
|
||
if ( f.deleteTemplate(positionNumber) == True ): | ||
print('Template deleted!') | ||
|
||
except Exception as e: | ||
print('Operation failed!') | ||
print('Exception message: ' + str(e)) | ||
exit(1) |
Oops, something went wrong.