Compare commits
6 Commits
V0.2.3
...
Production
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
529379ee3b | ||
|
|
369a64ea98 | ||
|
|
a2152a6cf0 | ||
|
|
b329d8a3f9 | ||
|
|
a6d4a5ae87 | ||
|
|
5921a64b8f |
13
main.py
13
main.py
@@ -10,7 +10,8 @@ pir = MotionSensor(4)
|
||||
camera = PiCamera() #Camera Initialization
|
||||
GPIO.setwarnings(False)
|
||||
GPIO.setmode(GPIO.BCM) #Setting the GPIO Mode
|
||||
GPIO.setup(22, GPIO.OUT) #LED output pin
|
||||
GPIO.setup(22, GPIO.OUT) #LED Flash Output
|
||||
GPIO.setup(27, GPIO.OUT) #LED indicator output
|
||||
|
||||
cwd = os.getcwd() #Sets the Current Working Directory
|
||||
|
||||
@@ -21,6 +22,14 @@ def bugmotion():
|
||||
GPIO.output(22, 0) #Sets light off
|
||||
|
||||
print("\nProgram Running!")
|
||||
for i in range(3):
|
||||
time.sleep(1)
|
||||
GPIO.output(27, 1)
|
||||
time.sleep(1)
|
||||
GPIO.output(27, 0)
|
||||
if i == 3:
|
||||
break
|
||||
|
||||
|
||||
#To stabilize sensor and Camera
|
||||
time.sleep(2)
|
||||
@@ -38,7 +47,7 @@ def bugmotion():
|
||||
# Grab the current time
|
||||
filePath = cwd + "/Pictures/"
|
||||
currentTime = datetime.now()
|
||||
picTime = currentTime.strftime("%Y.%m.%d-%H%M")
|
||||
picTime = currentTime.strftime("%Y-%m-%d-%H-%M-%S")
|
||||
picName = "Capture-" + picTime + '.jpg'
|
||||
completeFilePath = filePath + picName
|
||||
#file_name = cwd + "/Pictures/Capture_" + str(time.time()) + ".jpg"
|
||||
|
||||
Reference in New Issue
Block a user