Today I analyzed the source code for the RoastLogger software. This source code is an Arduino sketch that is modified to be compatible with the Roast Logger program. The default output is in Celsius but I changed it into Fahrenheit. The pseudo-code for some main functions of this software looks as below:
1. Setup
– Delay 10s for start up
– Initialize the variables
- Heater
- Fan
- Thermocouple 1
- Thermocouple 2
- Rate of Rise (RoR)
– Initialize the display/input device
– Initialize ambient temp filtering
– Read calibration and identification from data from eeprom
- If (eeprom is working normally)
- Print (“# EEPROM data read: “)
- Starting reading and printing the data
- Else (problem with eeprom read)
- Print (“# Failed to read EEPROM. Using default calibration data. “)
– Digital filtering on the data read
- Bean Temperature (BT)
- Environment Temperature(ET)
- Rate of Rise (RoR) calculation and values
2. Loop (each loop takes exactly 1 second)
– Buffer the input from serial port
– Process interface events
– Process loop conditions
- If (last loop takes more than or equal to 1 second)
- Take another sample
- Retrieve values from MCP9800 and MCP3424
- Output data to serial ports
- Update value for display
– Report if we don’t have at least 50ms left
- Print (“# idle: “)