Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
synthraxg authored Oct 25, 2018
1 parent db7b051 commit 5a0febf
Show file tree
Hide file tree
Showing 33 changed files with 1,837 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 1.py
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")



113 changes: 113 additions & 0 deletions DCMOTOR.txt
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")


30 changes: 30 additions & 0 deletions IOT/1.py
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")



113 changes: 113 additions & 0 deletions IOT/DCMOTOR.txt
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")


44 changes: 44 additions & 0 deletions IOT/Fingerprint/Fingerprint_delete.py
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)
Loading

0 comments on commit 5a0febf

Please sign in to comment.