Skip to content

Instantly share code, notes, and snippets.

@duncandoo
duncandoo / espRFIDRelayController.ino
Created January 31, 2017 23:25
Arduino IDE code to run an ESP8266 with a RFID reader to get and keep a list of authorised tags over MQTT. When an authorised tag is presented a relay is activated
/*
espRFIDRelaycontroller by Duncan McPherson
Use a RFID-RC522 and ESP8266-12e to control a relay to activate
a machine for authorised users. Pick up the list of authorised users from an MQTT server.
*/
#include <EEPROM.h> // To read and write PICC's UIDs from/to EEPROM
#include <SPI.h> // RC522 Module uses SPI protocol
@duncandoo
duncandoo / beamerPoster.Rnw
Last active February 26, 2016 23:34
Reproducible poster using knitr to knit R code into a LaTeX beamer poster. It produces a A0 size poster describing work we've done to improve analgesia for patients with hip fracture. It won't compile straight from these files: you will need to add some data and download the NHS logo, accepting the terms and conditions. The template uses NHS col…
\documentclass[final]{beamer}
\usetheme{NHS}
\usefonttheme[stillsansserifsmall]{serif}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[orientation=portrait,size=a0, scale=1.5]{beamerposter}
\usepackage[numbers,sort]{natbib}
% This is based on the template at http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php
#
# Functions to make ggplot KM survivor curves made with survfit() in library(survival)
#
# code written by Ramon Saccilotto
# and included in his ggplot2 tutorial
# 2010-12-08
# define custom function to create a survival data.frame
createSurvivalFrame <- function(f.survfit){
# initialise frame variable