This file contains hidden or 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
#!/bin/bash | |
RUN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
echo "installing amazon-kinesis-video-streams-webrtc-sdk-c build dependencies" | |
sudo apt-get install -y \ | |
pkg-config \ | |
cmake \ | |
zip \ | |
libssl-dev \ |
This file contains hidden or 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 smbus | |
import time | |
from datetime import datetime | |
bus = smbus.SMBus(1) | |
DEVICE = 0x20 # Device address (A0-A2) | |
IODIRA = 0x00 | |
OLATA = 0x14 | |
GPIOA = 0x12 |
This file contains hidden or 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
## View the video feed on the Rasperry Pi itself | |
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=1280, height=720, framerate=30/1 ! videoflip method=rotate-180 ! videoconvert \ | |
! videoscale ! clockoverlay time-format="%D %H:%M:%S" ! video/x-raw, width=640, height=360 ! autovideosink | |
## Start the video stream from the Rasperry Pi | |
export HOST_IP=192.168.1.100 | |
gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=-1 ! video/x-raw, width=640, height=480, framerate=30/1 ! \ |
This file contains hidden or 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 | |
import time | |
WATER_SENSOR_PIN = 23 | |
RELAY_CONTROL_PIN = 27 | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(WATER_SENSOR_PIN, GPIO.IN) | |
GPIO.setup(RELAY_CONTROL_PIN, GPIO.OUT) |
OlderNewer