We have released the Arduino code at https://github.com/abefetterman/Ember-Kit. You will need the Arduino file (ember_arduino), and you will need to put the Ember and PID libraries into your Arduino library folder. A main code snapshot is at the bottom of this document (for the most current version, see github).
Key objects and their external functions are,
led: this allows us to write to the 4×7 segment led.
void led.write(double writeValue, bool displayPos): This takes the value to be written (writeValue) and whether we are displaying the setpoint (which switches all the decimal points on)
encoder: this interfaces with the knob to set the target temperature
double encoder.read(): returns the current set temperature in Celcius
double encoder.printTemp(double temp): Returns either the temperature in C or F, or the current setpoint in C or F if setpoint display is active
TempSensor: a virtual type; all actual temperature sensors inherit from this. Set the type in the preamble.
double temp.getTemp(): takes a new reading and returns the current temperature
pid: from the Arduino PID Library
tempTimer/pidTimer (long period): these are of a DoEvery type we have created to repeat things every period
void timer.reset(): sets timer to zero
boolean timer.check(): returns true once every period, and must be called to update the timer for other functions
boolean timer.before(double threshTime): true if the time since the last check() returning true is less than threshTime (in milliseconds).