Skip to content

Instantly share code, notes, and snippets.

View dave-malone's full-sized avatar

Dave Malone dave-malone

  • Amazon Web Services
  • Tampa, FL
View GitHub Profile
@dave-malone
dave-malone / echo.sh
Last active March 24, 2021 14:51
Just a simple echo script
#!/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 \
@dave-malone
dave-malone / mcp23017.py
Created April 8, 2021 21:05
Raspberry Pi GPIO LED Binary Clock driven by the MCP23017 port expander
import smbus
import time
from datetime import datetime
bus = smbus.SMBus(1)
DEVICE = 0x20 # Device address (A0-A2)
IODIRA = 0x00
OLATA = 0x14
GPIOA = 0x12
@dave-malone
dave-malone / gstreamer-pipeline-examples.sh
Created June 28, 2022 18:03
Gstreamer pipeline examples
## 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 ! \
@dave-malone
dave-malone / auto_topoff.py
Last active June 30, 2022 20:21
A simple Python program for Raspberry Pi that initiates a pump to deliver water from a reservoir when a water sensor reading returns a value indicating that the water level is running low
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)