Skip to content

Instantly share code, notes, and snippets.

View brooksware2000's full-sized avatar

Curtis Brooks brooksware2000

View GitHub Profile
@brooksware2000
brooksware2000 / READ_TEMPERATURE.ino
Created August 7, 2012 02:07
MAX6675 temperature sampling routine. Routine stores sampled values in an array and returns the average.
'-------------------------------------------------------------------------------
' Read temperature
'-------------------------------------------------------------------------------
READ_TEMPERATURE:
'Get a sampling of temperature values and write to temperature array
FOR index = 0 TO BUFFERSIZE - 1
LOW CS
SHIFTIN DAT, CLK, 0,[curTemp\16]
HIGH CS
@brooksware2000
brooksware2000 / PROCESS_PHASE-COMPUTE_PID.ino
Created August 7, 2012 02:17
Routines to compute PID value and regulate heater controls
'-------------------------------------------------------------------------------
' Regulates heater controls based on phase temperature parameters
'-------------------------------------------------------------------------------
PROCESS_PHASE:
GOSUB READ_TEMPERATURE
GOSUB COMPUTE_PID
WHILE (elapsedTime <> 0)
IF (SecondsChanged = 1) THEN
elapsedTime = elapsedTime - 1
@brooksware2000
brooksware2000 / RAMP_UP.ino
Created August 7, 2012 02:20
Routine to quickly ramp temperature up to the setpoint value
'-------------------------------------------------------------------------------
' Ramps up to setpoint
'-------------------------------------------------------------------------------
RAMP_UP:
GOSUB StartTimer
WHILE (curTemp < setpoint)
IF (SecondsChanged = 1) THEN
GOSUB READ_TEMPERATURE
GOSUB COMPUTE_PID
@brooksware2000
brooksware2000 / INSTANT_INTERRUPTS.ino
Created August 7, 2012 02:25
Elapsed timer routine. Interrupt is set to fire in 1 second intervals.
'-------------------------------------------------------------------------------
' Instant Interrupts Elapsed Timer routine
'-------------------------------------------------------------------------------
ASM
INT_LIST macro ;IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ClockCount, PBP, yes
endm
;Creates the interrupt processor
INT_CREATE
@brooksware2000
brooksware2000 / PCF8574A.pde
Created August 7, 2012 04:11
PCF8574A I2C I/O routine
/******************************************************************************
* PCF8574A I2C Output
*
* Prototype I2C interface to PCF8574A I/O Expander.
*
* Arduino analog input 5 - I2C SCL
* Arduino analog input 4 - I2C SDA
*
******************************************************************************/
@brooksware2000
brooksware2000 / AD595_Serial.ino
Created August 8, 2012 03:20
Sample sketch for the AD595 Thermocouple sensor.
/*
Demonstration sketch for Hobbybotics AD595 Thermocouple breakout board.
Reads temperature from AD595 in Celsius and Fahrenheit. Prints results to serial monitor.
*/
#include <AD595.h>
AD595 thermocouple;
@brooksware2000
brooksware2000 / AD595_LCD.ino
Created August 8, 2012 03:25
Sample sketch for the AD595 Thermocouple sensor. Prints to a I2C LCD.
/*
Demonstration sketch for Hobbybotics AD595 Thermocouple breakout board.
Reads temperature from AD595 in Celsius and Fahrenheit. Prints results to I2C LCD.
*/
#include <AD595.h>
#include <LCD.h>
#include <Wire.h>
@brooksware2000
brooksware2000 / blink.ino
Created August 8, 2012 17:45
Example blink sketch
@brooksware2000
brooksware2000 / SHT15_Serial.ino
Created August 9, 2012 00:03
Example sketch for the SHT15 humidity/temperature sensor.
/*
Demonstration sketch for Hobbybotics SHT1x humidity/temperature sensor
breakout V1.o.
Reads humidity, temperature (Celsius) and temperature (Fahrenheit).
Displays results to Serial Monitor.
*/
#include <SHT15.h>
@brooksware2000
brooksware2000 / SHT15_LCD.ino
Created August 9, 2012 00:07
Example sketch for the SHT15 humidity/temperature sensor. Prints results to an I2C LCD.
/*
Demonstration sketch for Hobbybotics SHT1x humidity/temperature sensor
breakout V1.o.
Reads humidity, temperature (Celsius) and temperature (Fahrenheit).
Displays results to LCD.
*/
#include <LCD.h>
#include <SHT15.h>