Hardware update: only distance less than 15cm for 5 sec then will take thief picture
This commit is contained in:
parent
75ab50acc1
commit
a652f95890
1 changed files with 14 additions and 11 deletions
|
@ -54,7 +54,7 @@ class Car:
|
||||||
|
|
||||||
# countor for theaf picture been taken
|
# countor for theaf picture been taken
|
||||||
self.counter = self.firebase.database().child("signal").child(1).child("counter").get().val()
|
self.counter = self.firebase.database().child("signal").child(1).child("counter").get().val()
|
||||||
print(str(self.counter))
|
#print(str(self.counter))
|
||||||
|
|
||||||
# new update motor and alarm functions, are able to connect embedded system throught firebase
|
# new update motor and alarm functions, are able to connect embedded system throught firebase
|
||||||
|
|
||||||
|
@ -180,6 +180,9 @@ if __name__=="__main__":
|
||||||
|
|
||||||
# Take a picture of someone or some thing try to get close to the vehicle
|
# Take a picture of someone or some thing try to get close to the vehicle
|
||||||
if (dist<=15 and car.cameraOff and car.motorStop and car.alarmStop):
|
if (dist<=15 and car.cameraOff and car.motorStop and car.alarmStop):
|
||||||
|
time.sleep(5)
|
||||||
|
dist = car.distance()
|
||||||
|
if (dist<=15):
|
||||||
print('Take a theaf picture due to distance at ' + str(int(dist)) + 'cm')
|
print('Take a theaf picture due to distance at ' + str(int(dist)) + 'cm')
|
||||||
camera = PiCamera()
|
camera = PiCamera()
|
||||||
camera.start_preview()
|
camera.start_preview()
|
||||||
|
|
Loading…
Reference in a new issue