Skip to content

Instantly share code, notes, and snippets.

View garethfoote's full-sized avatar

Gareth Foote garethfoote

View GitHub Profile
// Make variables to be used throughout code
int sensorPin = A0;
int ledPin = 13;
void setup() {
// Tell pin 13 to work as an output:
pinMode(ledPin, OUTPUT);
}
void loop() {
// Make variables for the led, button pin number and delay
// These can be used throughout your code
int ledPin = 13;
int buttonPin = 7;
int delayMs = 250;
void setup() {
// Tell pin 13 to work as an OUTPUT
pinMode( ledPin, OUTPUT );
// Tell pin 7 to work as an INPUT
// Make variables for the led pin number and delay
// These can be used throughout your code
int ledPin = 13;
int delayMs = 1000;
void setup() {
// Tell pin 13 to work as an output
pinMode( ledPin, OUTPUT );
}
@garethfoote
garethfoote / rtsp-to-mp4.sh
Last active May 19, 2022 12:12
Convert RTSP stream into 60 second mp4 segments with local machine time as filename: Ymd-HM
if [ -z "$1" ]; then
IP_ADDRESS=10.164.208.102
else
IP_ADDRESS=$1
fi
# FFMPEG command for creating segments from RTSP stream
ffmpeg -i rtsp://@${IP_ADDRESS}:5554/playlist.m3u -c copy -map 0 -f segment -strftime 1 -segment_time 60 -segment_format mp4 "%Y%m%d-%H%M.mp4"
@garethfoote
garethfoote / index.html
Created May 2, 2017 16:16
JavaScript - DOM Selection & Manipulation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JavaScript Example</title>
</head>
<body>
<h1>This is a JS Example.</h1>
<span class="time">What's the time?!</span>
<hr/>
@garethfoote
garethfoote / mp3trigger_softserial.ino
Last active May 31, 2017 10:27
Using soft serial for MP3 Trigger.
#include <SoftwareSerial.h>
SoftwareSerial sSerial(10, 11); // RX, TX
void setup() {
Serial.begin(9600);
while (!Serial);
// set the data rate for the SoftwareSerial port
sSerial.begin(38400);
@garethfoote
garethfoote / auto-arduino.pde
Created November 25, 2016 11:54 — forked from unknowndomain/auto-arduino.pde
This is an example of how to connect to an Arduino automatically in Processing
import processing.serial.*;
Serial arduino;
void setup() {
// Create a canvas
size( 800, 600 );
// Get a list of serial ports
String ports[] = Serial.list();
int id = 0;
P-I-C
├── 3D Workshop
├── Animation & Game Design
└── Prototype & Code
├── Computing
├── Physical
└── Programming
/*
* V&A Wearables Prototype - Using a ... to change the ....
* @author Your name goes here.
* 13th November 2015
*
*/
#include "pitches.h"
int sensorPin = 1; // The number of the input pin for the pressure sensor