from gpiozero import MotionSensor
from gpiozero import Buzzer
from classes.network import Network
import time

# Network setup
server = Network(12345)

# Buzzer setup
bz = Buzzer(17)

# MotionSensor setup
ms = MotionSensor(7)

print("Warming up")
i = 10000000
while i > 0:
    i = i - 1
print("Done warming up")

try:
    while True:
        if ms.motion_detected:
            print("Motion detected!")
            server.alert_server("Motion detected!")
            bz.on()
            time.sleep(5)
            bz.off()
except KeyboardInterrupt:
    print("Quitting")
    server.close_connection()

31fae07dd5af11ba6d83bdb341280442ab325068
<mask token>

<mask token>
print('Warming up')
<mask token>
while i > 0:
    i = i - 1
print('Done warming up')
try:
    while True:
        if ms.motion_detected:
            print('Motion detected!')
            server.alert_server('Motion detected!')
            bz.on()
            time.sleep(5)
            bz.off()
except KeyboardInterrupt:
    print('Quitting')
    server.close_connection()

<mask token>
server = Network(12345)
bz = Buzzer(17)
ms = MotionSensor(7)
print('Warming up')
i = 10000000
while i > 0:
    i = i - 1
print('Done warming up')
try:
    while True:
        if ms.motion_detected:
            print('Motion detected!')
            server.alert_server('Motion detected!')
            bz.on()
            time.sleep(5)
            bz.off()
except KeyboardInterrupt:
    print('Quitting')
    server.close_connection()

from gpiozero import MotionSensor
from gpiozero import Buzzer
from classes.network import Network
import time
server = Network(12345)
bz = Buzzer(17)
ms = MotionSensor(7)
print('Warming up')
i = 10000000
while i > 0:
    i = i - 1
print('Done warming up')
try:
    while True:
        if ms.motion_detected:
            print('Motion detected!')
            server.alert_server('Motion detected!')
            bz.on()
            time.sleep(5)
            bz.off()
except KeyboardInterrupt:
    print('Quitting')
    server.close_connection()

from gpiozero import MotionSensor
from gpiozero import Buzzer
from classes.network import Network
import time

# Network setup
server = Network(12345)

# Buzzer setup
bz = Buzzer(17)

# MotionSensor setup
ms = MotionSensor(7)

print("Warming up")
i = 10000000
while i > 0:
    i = i - 1
print("Done warming up")

try:
    while True:
        if ms.motion_detected:
            print("Motion detected!")
            server.alert_server("Motion detected!")
            bz.on()
            time.sleep(5)
            bz.off()
except KeyboardInterrupt:
    print("Quitting")
    server.close_connection()
