Skip to content

Instantly share code, notes, and snippets.

View carlcrott's full-sized avatar

Carl Crott carlcrott

  • <( '.' <) <( '.' )> (> '.' )>
  • San Francisco CA
View GitHub Profile
@carlcrott
carlcrott / gist:3983909
Created October 30, 2012 23:57
Upload this onto an Uno to find out the top and bottom value of the encoder you're working with
/* Rotary encoder read example */
/* Verified as working on Arduino Uno */
// connect ENCA pin to Uno pin 8
#define ENC_A 8
// connect ENCA pin to Uno pin 9
#define ENC_B 9
#define ENC_PORT PINB
void setup()
@carlcrott
carlcrott / gist:3983954
Created October 31, 2012 00:05
Mayhew Labs Encoder ring code
/*
TODO: Isolate the read_encoder() output and make sure that's correct before attempting to anything with it. Then you're working with -1 for one direction, 1 for the other direction, and 0 for sitting still.
Rotary_Encoder_LED_Ring_Example
www.mayhewlabs.com/products/rotary-encoder-led-ring
Copyright (c) 2011 Mayhew Labs.
Written by Mark Mayhew
This example shows 3 sequences that are possible on the ring of LEDs around the encoder based on rotation of an encoder. The 3 sequences are
/*
TODO: Isolate the read_encoder() output and make sure that's correct before attempting to anything with it. Then you're working with -1 for one direction, 1 for the other direction, and 0 for sitting still.
Rotary_Encoder_LED_Ring_Example
www.mayhewlabs.com/products/rotary-encoder-led-ring
Copyright (c) 2011 Mayhew Labs.
Written by Mark Mayhew
This example shows 3 sequences that are possible on the ring of LEDs around the encoder based on rotation of an encoder. The 3 sequences are
// OSH orbital shaker: www.black-glass.com
// TYVM Mayhew Labs: www.mayhewlabs.com/products/rotary-encoder-led-ring
// TYVM Mike McCauley: www.open.com.au/mikem/arduino/AccelStepper/
#include <AccelStepper.h>
// ####### Encoder Variables #######
//These are the pins that will talk to the shift register through SPI
#define SDI 11 //Data
$status=file($folder . DIRECTORY_SEPARATOR . "STATUS");
if ($status === FALSE) {
$status = array();
}
// check the global status
switch(checkStatus("CONFIG")) {
case 0:
$nextenabled="disabled=\"disabled\"";
header( "refresh:5" );
class Rails::Boot
def run
load_initializer
Rails::Initializer.class_eval do
def load_gems
@bundler_loaded ||= Bundler.require :default, Rails.env
end
end
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="transBluePoly">
<LineStyle>
<width>1.5</width>
</LineStyle>
<PolyStyle>
<color>7dff0000</color>
</PolyStyle>
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://www.opengis.net/kml/2.2">
<NetworkLink>
<open>1</open>
<name>Generate KML</name>
<LookAt>
<longitude>38.7967300867703</longitude>
<latitude>9.10044661562672</latitude>
<range>2420480.59204561</range>
</LookAt>
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Paths</name>
<description>Examples of paths. Note that the tessellate tag is by default
set to 0. If you want to create tessellated lines, they must be authored
(or edited) directly in KML.</description>
<Style id="yellowLineGreenPoly">
<LineStyle>
<color>7f00ffff</color>
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="transBluePoly">
<LineStyle>
<width>1.5</width>
</LineStyle>
<PolyStyle>
<color>7f000000</color>
</PolyStyle>