Skip to content

Instantly share code, notes, and snippets.

@Workshopshed
Workshopshed / loopbackinterupt.ino
Created August 9, 2023 19:46
A test to do see if we can modify the volatile variable in the middle of a switch
volatile uint8_t position = 0;
uint8_t test = 0;
const byte outpin = 3; //Wire from 2 to 3
const byte interruptPin = 2;
void setup() {
pinMode(outpin, OUTPUT);
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Workshopshed
Workshopshed / compass.js
Created December 13, 2019 22:13
Synchronising React components
const e = React.createElement;
const rangestyle = {
width: '100%'
};
class Compass extends React.Component {
constructor(props) {
super(props);
this.state = { value: 180 }
@Workshopshed
Workshopshed / ConsecutiveGroupBy.cs
Last active November 6, 2019 22:41
ConsecutiveGroupBy using Generics
//A consecutive groupby in Linq and C#
//proof of concept for merging some date range like objects
//Based on https://www.daniweb.com/programming/software-development/code/488977/linq-consecutive-groupby
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsecutiveGroupBy {
public static class Extensions {
using System;
using System.Collections.Concurrent;
using System.Collections.Specialized;
using System.Threading.Tasks;
using Quartz;
using Quartz.Impl;
namespace QuartzSampleApp {
public class Program {
@Workshopshed
Workshopshed / Eye.scad
Last active October 22, 2016 19:25
Flashing Eye Model
module eye() {
shellsize = 16;
difference() {
union() {
scale([1,0.9,0.75])
difference() {
sphere(r=shellsize);
sphere(r=shellsize-1.5);
translate([0,0,shellsize/2])
cube([70,70,shellsize],center=true);
@Workshopshed
Workshopshed / Face.ino
Last active July 22, 2016 12:00
A demo of the boards
#include "FastLED.h"
#define NUM_LEDS 14
#define DATA_PIN 4
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.clear();
@Workshopshed
Workshopshed / Lymeric
Last active April 27, 2016 11:27
In response to Elecia White's complaint that there arn't enough things that rhyme with google to form a lymeric
An engineering team from Google
sought the help of a chap called McDoogle
they searched through lochness
their results were a mess
as all they could find was a poodle
@Workshopshed
Workshopshed / Servo.py
Last active October 3, 2016 18:22
Controlling a Raspberry Pi Servo with RPIO
from RPIO import PWM
from time import sleep
servo = PWM.Servo()
# https://pythonhosted.org/RPIO/pwm_py.html
# BCM GPIO numbering
# From Arduino Servo library, standards are:
# min is 544, max is 2400
# But for RPIO need to be in multiples of 10us