Skip to content

Instantly share code, notes, and snippets.

@pwillard
pwillard / PD2435
Created April 20, 2015 00:35
Arduino, a DHT11 and a PD2437 walk into a bar.
//==============================================================================
// PPPP DDDD 2222 4 4 3333 77777 III N N OOOOO
// P P D D 2 4 4 3 7 I NN N O O
// PPPP D D 222 44444 333 7 I N N N O O
// P D D 2 4 3 7 .. I N NN O O
// P DDDD 22222 4 3333 7 .. III N N OOOOO
//==============================================================================
//==============================================================================
// Program: PD2437.ino
/*
This when finished will control a glass kiln with 4 settings
have a ramp to temp/ and timers based on system 96 glass settings.
Special thanks to:
Ryan McLaughlin <ryanjmclaughlin@gmail.com MAX6675
Brett Beauregard <www.brettbeauregard.com PID_Beta6
David A. Mellis SoftWareSerial
Jesse Tane for http://labs.ideo.com TimerOne
Bart Meijer (bart@sbo-dewindroos.nl) AdvButton an ButtonManager
and zer0vector from the Arduino forum for pointing out the TimerOne function
Color Value Multiplier Tolerance
Black 0 1
Brown 1 10 1%
Red 2 100 2%
Orange 3 1,000 3%
Yellow 4 10,000 4%
Green 5 100,000 0.5%
Blue 6 1,000,000 0.25%
Violet 7 10,000,000 0.1%
Symbol Function
~ bit-wise NOT, also called "one's complement"
| bit-wise OR
& bit-wise AND
^ bit-wise Exclusive OR (XOR)
<< Bit Shift Left
>> Bit Shift Right

If you really hate these operator symbols, you can try including iso646.h into your code and become a real outcast and rebel coder among your peers. It will give more meaningful names to your "logical" operations:

{line-numbers=off, language=C++}

    #ifndef __cplusplus
    #define   and         &&
    #define   and_eq      &=
    #define   bitand      &
    #define   bitor       |
 #define compl ~
@pwillard
pwillard / thermistor.ino
Created February 9, 2016 13:52
Thermistor calibration
void setup()
{
Serial.begin(115200);
double R1, R2, R3, T1, T2, T3;
R1 = 51000; // resistance in ohms
T1 = 22.45; // temp in celcius
// Boiling water at 700ft altitude
@pwillard
pwillard / tolerance.md
Created March 4, 2016 12:44
Standard Values and Tolerance

#Electronics Color Code Because some components are quite small and hard to stamp with text based numerical values, color codes are used to identify the value of these components. These follow a progression based on prismatic colors, like those a rainbow. Axial lead components are color coded with circumferential bands of color to indicate resistance, capacitance and inductance as well as tolerance.

The component value can be decoded by starting with the band closest to one end of the part, where the first 2 bands are value and the 3rd color is a multiplier and the 4th band being tolerance. There also exists a 5 band standard where the first 3 bands are value and the 4th band is a multiplier and the 5 band is tolerance. The five band notation is more common with components with better than 5% tolerances.

Color Value Multiplier Tolerance
Black 0 1
Brown 1 10 1%
@pwillard
pwillard / wprogram.md
Created March 11, 2016 16:59
Wprogram

WProgram and Arduino

One of the difficult changes that occurred in the move from the early Arduino Environment release to version 1.0 is the name change of the header file from WProgram.h to Arduino.h. It was a good change, but it broke all of the libraries that were created prior to version 1.0 so there were many existing libraries that needed to be fixed before sketches could be compiled without errors again. The file, WProgram.h, actually means "Wiring Program" and since Arduino is not Wiring anymore but is a fully developed fork of it, it made sense to change it to match the new Arduino IDE environment. At the same time, the default extension of "PDE" was changed to "INO" for very similar reasons, since PDE is the extension name for "Processing Development Environment". Prior to version 1 of the IDE, the PDE extension made it difficult to quickly identify true Processing code that was intended for the users computer from the code that was intended for the Arduino device. I

A proper and as constant Temperature (45-58F) as possible
Specific Moisture level for the specific cheeses (~ 80-98%)
A certain amount of Fresh Air to remove by products of aging