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
<?php | |
namespace App; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
class Worker extends Authenticatable | |
{ | |
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
private WebView webSurface; | |
String vidAddress = "http://192.168.43.25/view"; | |
........ | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
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
......... | |
//pubnub channels | |
String GARAGE_DOOR = "GARAGE_DOOR"; | |
String FRONT_DOOR = "FRONT_DOOR"; | |
String CAMERA = "CAMERA"; | |
......... | |
// payloads |
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
................. | |
PubConSubThread pubConSubThread;//connect and subscribe | |
PubPublishThread pubPublishThread;//Publish | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
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
.......... | |
//payloads | |
String sensors_Data = "get data"; | |
else if (status.getCategory() == PNStatusCategory.PNConnectedCategory){ | |
pp.pubnubPublish(sensors_Data, SENSORS); | |
if (status.getCategory() == PNStatusCategory.PNConnectedCategory){ | |
connectProgress(Color.GREEN, "Connected"); |
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
import multiprocessing | |
def continueScript(): | |
try: | |
while True: | |
sleep(0.3) | |
except KeyboardInterrupt: | |
# stop all servos | |
CServo.stop_servo(pinCServo) |
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
import RPi.GPIO as GPIO | |
from numpy import interp | |
p = GPIO.PWM(pinNetwork, 50) # set Frequece to 1KHz | |
p.start(0) | |
bedroom = GPIO.PWM(pinBedroomLight, 50) # set Frequece to 1KHz | |
bedroom.start(0) | |
sittingroom = GPIO.PWM(pinSittingRoomLight, 50) # set Frequece to 1KHz |
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
from RPIO import PWM | |
CServo = PWM.Servo() | |
# move servo to your desired default position and give it time to arrive there | |
CServo.set_servo(pinCServo, 1500) | |
sleep(1) | |
fDoorServo = PWM.Servo() |
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
def garageMotion(pinPIR_garage): | |
if sm.securityStatus: | |
if GPIO.input(pinPIR_garage): | |
print('pinPIR_garage motion detected') | |
GPIO.output(pinAlarm , GPIO.HIGH) | |
GPIO.output(pinGarageLight, GPIO.HIGH) | |
sleep(1) | |
CServo.set_servo(pinCServo, 1500) | |
pubnub.publish().channel(SENSORS).message(MOTION_PIR2).async(my_publish_callback) |
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
// Create Gpio Controller | |
GpioController gpio = GpioFactory.getInstance(); |
OlderNewer