Skip to content

Instantly share code, notes, and snippets.

@sjurlur
sjurlur / Apekatt
Last active December 14, 2015 16:38
Den bråkete apekatten
const int M1 = 4; // H-bridge leg 1 (pin 2, 1A)
const int E1 = 5;
const int M2 = 8; // H-bridge leg 2 (pin 7, 2A)
const int E2 = 9;
const int mouthPin = 2;
//const int knapp = 3;
char mouth;
boolean state = true;
const int enablePin = 10; // H-bridge enable pin
@sjurlur
sjurlur / gist:5188018
Created March 18, 2013 15:32
Hall effect
/*
Hall Effect Switch
Turns on and off a light emitting diode(LED) connected to digital
pin 13, when Hall Effect Sensor attached to pin 2 is triggered by a magnet
Hall effect sensor used is the A1120EUA from Allegro Microsystems
This example code is in the public domain.