Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e1e81cc6f | ||
|
|
a01cb7a4be | ||
|
|
cb5d4bc49d | ||
|
|
67e3c44f54 | ||
|
|
e47753d5ab | ||
|
|
07d9b15ecc |
35
README.md
35
README.md
@@ -48,28 +48,41 @@ Pressing both buttons will also exit the soldering mode.
|
||||
## Settings Menu
|
||||
This menu allows you to cycle through all the options and set their values.
|
||||
The button near the tip cycles through the options, and the one near the usb changes the selected option.
|
||||
Note that settings are not saved until you exit the menu, and some settings such as screen flip do not apply until a power cycle is applied.
|
||||
|
||||
* UVCO -> Undervoltage cut out level, settable in 1V increments from 10-24V
|
||||
* STIME -> Sleep time, how long it takes before the unit goes to sleep
|
||||
* SLTME -> Sleep time, how long it takes before the unit goes to sleep
|
||||
* STMP -> The temperature the unit drops to in sleep mode
|
||||
* SHTME -> Shutdown Time, how long the unit will wait after movement before shutting down completely
|
||||
* MOTION -> Wether motion detection is enabled or not
|
||||
* TMPUNIT -> Temperature unit, C or F
|
||||
* FLPDSP -> Flip display for left handed users
|
||||
* SENSE -> Motion Sensitivity, H is more sensitive. L is lowest sensitivity (ie takes more movement to trigger)
|
||||
|
||||
## Extras Menu
|
||||
This menu defaults to showing the current temperature on the tip. Pressing the button near the iron tip will show the current input voltage. Pressing the button near the usb enters the temperature offset setting menu, when the iron is cold, pressing the other button will start the unit calibrating for any offset in the tip temperature.
|
||||
This menu defaults to showing the current temperature on the tip.
|
||||
Pressing the button near the iron tip will show the current input voltage. Pressing the other button while this is show will allow you to calibrate the reading if your iron is like mine and is not overly accurate out of the factory. (Press buttons to change measurement up and down, press both to exit and save).
|
||||
|
||||
Pressing the button near the usb enters the temperature offset setting menu, when the iron is cold, pressing the other button will start the unit calibrating for any offset in the tip temperature.
|
||||
|
||||
# Version Changes:
|
||||
V1.06
|
||||
- Changes H and C when the iron is heating to the minidso chevron like images
|
||||
|
||||
V1.05
|
||||
- Adds ability to calibrate the input voltage measurement
|
||||
|
||||
V1.04
|
||||
- Increased accuracy of the temperature control
|
||||
- Improved PID response slightly
|
||||
- Allows temperature offset calibration
|
||||
- Nicer idle screen
|
||||
- Increased accuracy of the temperature control
|
||||
- Improved PID response slightly
|
||||
- Allows temperature offset calibration
|
||||
- Nicer idle screen
|
||||
|
||||
V1.03
|
||||
- Improved Button handling
|
||||
- Ability to set motion sensitivity
|
||||
- DC voltmeter page shows input voltage
|
||||
- Improved Button handling
|
||||
- Ability to set motion sensitivity
|
||||
- DC voltmeter page shows input voltage
|
||||
|
||||
V1.02
|
||||
- Adds hold both buttons on IDLE to access the therometer mode.
|
||||
- Changes the exit soldering mode to be holding both buttons (Like original firmware).
|
||||
- Adds hold both buttons on IDLE to access the therometer mode.
|
||||
- Changes the exit soldering mode to be holding both buttons (Like original firmware).
|
||||
|
||||
@@ -163,4 +163,30 @@ const uint8_t Iron_RightArrow_DOWN[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
const uint8_t SymbolTable[]={
|
||||
|
||||
0x0E,0x11,0x11,0x0E,0xE0,0xF8,0x0C,0x06,0x03,0x01,0x01,0x01,0x01,0x02,0x1E,0x00,
|
||||
0x00,0x00,0x00,0x00,0x0F,0x3F,0x70,0xC0,0x80,0x80,0x80,0x80,0x80,0x40,0x20,0x00, // Degrees C
|
||||
|
||||
0x08,0x14,0x22,0x14,0x08,0x02,0x02,0xFE,0x06,0x02,0x02,0x02,0xC2,0x02,0x06,0x1E,
|
||||
0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x81,0x81,0x01,0x01,0x03,0x00,0x00,0x00, // Degrees F
|
||||
|
||||
0xC0,0x30,0x08,0x04,0x04,0x02,0xFA,0xAA,0xFA,0x02,0x04,0x04,0x08,0x30,0xC0,0x00,
|
||||
0x07,0x18,0x20,0x40,0x58,0xA4,0xDB,0xDE,0xDB,0xA4,0x58,0x40,0x20,0x18,0x07,0x00, // Temp symbol
|
||||
|
||||
0x00,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0xFC,0xF8,0xF0,0xE0,0xC0,0x80, //Right Arrow
|
||||
0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x3F,0x1F,0x0F,0x07,0x03,0x01,
|
||||
|
||||
0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0x00, //Left Arrow
|
||||
0x01,0x03,0x07,0x0F,0x1F,0x3F,0x00,0x00,0x0F,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,
|
||||
|
||||
0x11,0x33,0x66,0xCC,0x98,0x30,0x60,0xC0,0xC0,0x60,0x30,0x98,0xCC,0x66,0x33,0x11,
|
||||
0x01,0x03,0x06,0x0C,0x19,0x33,0x66,0xCC,0xCC,0x66,0x33,0x19,0x0C,0x06,0x03,0x01, //Down Chevron
|
||||
|
||||
0x80,0xC0,0x60,0x30,0x98,0xCC,0x66,0x33,0x33,0x66,0xCC,0x98,0x30,0x60,0xC0,0x80,
|
||||
0x88,0xCC,0x66,0x33,0x19,0x0C,0x06,0x03,0x03,0x06,0x0C,0x19,0x33,0x66,0xCC,0x88, //Up Chevron
|
||||
|
||||
0x00,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x8C,0x00, // Flat Lines
|
||||
0x00,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x00,
|
||||
};
|
||||
#endif /* FONT_H_ */
|
||||
|
||||
@@ -34,6 +34,7 @@ enum {
|
||||
UVCO = 0,
|
||||
SLEEP_TEMP,
|
||||
SLEEP_TIME,
|
||||
SHUTDOWN_TIME,
|
||||
MOTIONDETECT,
|
||||
MOTIONSENSITIVITY,
|
||||
TEMPDISPLAY,
|
||||
|
||||
@@ -25,7 +25,9 @@ void Clear_Screen(void);//Clear the screen
|
||||
void OLED_DrawString(char* string, uint8_t length);
|
||||
void OLED_DrawChar(char c, uint8_t x);
|
||||
void OLED_DrawTwoNumber(uint8_t in, uint8_t x);
|
||||
void OLED_BlankSlot(uint8_t xStart,uint8_t width);
|
||||
void OLED_DrawThreeNumber(uint16_t in, uint8_t x);
|
||||
void OLED_DrawIDLELogo();
|
||||
void OLED_DrawSymbol(uint8_t x,uint8_t symbol);
|
||||
#endif
|
||||
/******************************** END OF FILE *********************************/
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define SETTINGS_H_
|
||||
#include <stdint.h>
|
||||
#include "stm32f10x_flash.h"
|
||||
#define SETTINGSVERSION 0x04 /*Change this if you change the struct below to prevent people getting out of sync*/
|
||||
#define SETTINGSVERSION 0x05 /*Change this if you change the struct below to prevent people getting out of sync*/
|
||||
#define SETTINGSOPTIONSCOUNT 6 /*Number of settings in the settings menu*/
|
||||
#define MOTION_HIGH (0x00)
|
||||
#define MOTION_MED (0x10)
|
||||
@@ -20,15 +20,16 @@
|
||||
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
|
||||
*/
|
||||
struct {
|
||||
uint32_t SolderingTemp; //current setpoint for the iron
|
||||
uint32_t SolderingTemp; //current set point for the iron
|
||||
uint32_t SleepTemp; //temp to drop to in sleep
|
||||
uint8_t version; //Used to track if a reset is needed on firmware upgrade
|
||||
uint8_t SleepTime; //minutes timeout to sleep
|
||||
uint8_t cutoutVoltage:5; //The voltage we cutout at for undervoltage
|
||||
uint8_t cutoutVoltage:5; //The voltage we cut out at for under voltage
|
||||
uint8_t movementEnabled:1; //If movement is enabled
|
||||
uint8_t displayTempInF:1; //If we need to convert the C reading to F
|
||||
uint8_t flipDisplay:1; //If true we want to invert the display for lefties
|
||||
uint8_t sensitivity:7; //Sensitivity of accelerometer
|
||||
uint8_t ShutdownTime:7; //Time until unit shuts down if left alone
|
||||
uint16_t tempCalibration; //Temperature calibration value
|
||||
uint16_t voltageDiv; //Voltage divisor factor
|
||||
} systemSettings;
|
||||
|
||||
@@ -37,7 +37,7 @@ void setup() {
|
||||
readIronTemp(systemSettings.tempCalibration, 0,0); //load the default calibration value
|
||||
Init_Oled(systemSettings.flipDisplay); //Init the OLED display
|
||||
|
||||
OLED_DrawString("VER 1.05", 8); //
|
||||
OLED_DrawString("VER 1.07", 8); //
|
||||
delayMs(800); //Pause to show version number
|
||||
Start_Watchdog(1000); //start the system watch dog as 1 second timeout
|
||||
}
|
||||
|
||||
@@ -116,6 +116,11 @@ void ProcessUI() {
|
||||
systemSettings.SleepTime = 1; //cant set time over 30 mins
|
||||
//Remember that ^ is the time of no movement
|
||||
break;
|
||||
case SHUTDOWN_TIME:
|
||||
++systemSettings.ShutdownTime;
|
||||
if (systemSettings.ShutdownTime > 60)
|
||||
systemSettings.ShutdownTime = 0; //wrap to off
|
||||
break;
|
||||
case MOTIONDETECT:
|
||||
systemSettings.movementEnabled =
|
||||
!systemSettings.movementEnabled;
|
||||
@@ -142,16 +147,29 @@ void ProcessUI() {
|
||||
if (Buttons & BUT_A) {
|
||||
//A Button was pressed so we are moving back to soldering
|
||||
operatingMode = SOLDERING;
|
||||
Oled_DisplayOn();
|
||||
return;
|
||||
} else if (Buttons & BUT_B) {
|
||||
//B Button was pressed so we are moving back to soldering
|
||||
operatingMode = SOLDERING;
|
||||
Oled_DisplayOn();
|
||||
return;
|
||||
} else if (systemSettings.movementEnabled)
|
||||
if (millis() - getLastMovement() < 1000) {//moved in the last second
|
||||
operatingMode = SOLDERING; //Goto active mode again
|
||||
Oled_DisplayOn();
|
||||
return;
|
||||
}
|
||||
if (systemSettings.movementEnabled) {
|
||||
//Check if we should shutdown
|
||||
if ((millis() - getLastMovement()
|
||||
> (systemSettings.ShutdownTime * 60000))
|
||||
|| (millis() - getLastButtonPress()
|
||||
> systemSettings.ShutdownTime * 60000)) {
|
||||
operatingMode = COOLING; //shutdown the tip
|
||||
Oled_DisplayOn();
|
||||
}
|
||||
}
|
||||
//else if nothing has been pushed we need to compute the PID to keep the iron at the sleep temp
|
||||
int32_t newOutput = computePID(systemSettings.SleepTemp);
|
||||
setIronTimer(newOutput);
|
||||
@@ -281,41 +299,43 @@ void DrawUI() {
|
||||
Oled_DisplayOff();
|
||||
} else {
|
||||
Oled_DisplayOn();
|
||||
//OLED_DrawString(" IDLE ", 8); //write the word IDLE
|
||||
OLED_DrawIDLELogo();
|
||||
OLED_DrawIDLELogo(); //Draw the icons for prompting the user
|
||||
}
|
||||
break;
|
||||
case SOLDERING:
|
||||
//The user is soldering
|
||||
{
|
||||
if (getIronTimer() == 0) {
|
||||
OLED_DrawChar('C', 5);
|
||||
} else {
|
||||
if (getIronTimer() < 900) {
|
||||
OLED_DrawChar(' ', 5);
|
||||
} else { //we are heating
|
||||
OLED_DrawChar('H', 5);
|
||||
}
|
||||
}
|
||||
drawTemp(temp, 0);
|
||||
OLED_DrawChar(' ', 3);
|
||||
OLED_DrawChar(' ', 4);
|
||||
OLED_DrawChar(' ', 6);
|
||||
OLED_DrawChar(' ', 7);
|
||||
|
||||
OLED_BlankSlot(6 * 12 + 16, 24 - 16);//blank out the tail after the arrows
|
||||
OLED_BlankSlot(4 * 12 + 16, 24 - 16);//blank out the tail after the temp
|
||||
if (getIronTimer() == 0) {
|
||||
OLED_DrawSymbol(6, 5);
|
||||
} else {
|
||||
if (getIronTimer() < 900) {
|
||||
OLED_DrawSymbol(6, 7);
|
||||
} else { //we are heating
|
||||
//OLED_DrawChar('H', 5);
|
||||
OLED_DrawSymbol(6, 6);
|
||||
}
|
||||
}
|
||||
if (systemSettings.displayTempInF) {
|
||||
OLED_DrawSymbol(4, 1);
|
||||
} else {
|
||||
OLED_DrawSymbol(4, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TEMP_ADJ:
|
||||
//We are prompting the user to change the temp so we draw the current setpoint temp
|
||||
//With the nifty arrows
|
||||
|
||||
OLED_DrawChar(' ', 0);
|
||||
OLED_DrawChar('<', 1);
|
||||
drawTemp(systemSettings.SolderingTemp, 2);
|
||||
OLED_DrawChar(' ', 5);
|
||||
OLED_DrawChar(' ', 6);
|
||||
OLED_DrawChar('>', 7);
|
||||
|
||||
OLED_DrawChar(' ', 7);
|
||||
OLED_DrawChar('>', 6);
|
||||
break;
|
||||
case SETTINGS:
|
||||
//We are prompting the user the setting name
|
||||
@@ -331,9 +351,13 @@ void DrawUI() {
|
||||
OLED_DrawThreeNumber(systemSettings.SleepTemp / 10, 5);
|
||||
break;
|
||||
case SLEEP_TIME:
|
||||
OLED_DrawString("STIME ", 6);
|
||||
OLED_DrawString("SLTME ", 6);
|
||||
OLED_DrawTwoNumber(systemSettings.SleepTime, 6);
|
||||
break;
|
||||
case SHUTDOWN_TIME:
|
||||
OLED_DrawString("SHTME ", 6);
|
||||
OLED_DrawTwoNumber(systemSettings.ShutdownTime, 6);
|
||||
break;
|
||||
case MOTIONDETECT:/*Toggle the mode*/
|
||||
if (systemSettings.movementEnabled)
|
||||
OLED_DrawString("MOTION T", 8);
|
||||
@@ -371,6 +395,7 @@ void DrawUI() {
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -380,10 +405,19 @@ void DrawUI() {
|
||||
//Draw in temp and sleep
|
||||
OLED_DrawString("SLP", 3);
|
||||
drawTemp(temp, 4);
|
||||
|
||||
if (millis() - getLastMovement() > (10 * 60 * 1000)
|
||||
&& (millis() - getLastButtonPress() > (10 * 60 * 1000))) {
|
||||
//OLED off
|
||||
Oled_DisplayOff();
|
||||
} else {
|
||||
Oled_DisplayOn();
|
||||
}
|
||||
|
||||
break;
|
||||
case COOLING:
|
||||
//We are warning the user the tip is cooling
|
||||
OLED_DrawString("COOL", 4);
|
||||
OLED_DrawString("COOL ", 5);
|
||||
drawTemp(temp, 5);
|
||||
break;
|
||||
case UVLOWARN:
|
||||
|
||||
@@ -207,6 +207,14 @@ void OLED_DrawChar(char c, uint8_t x) {
|
||||
|
||||
Oled_DrawArea(x, 0, FONT_WIDTH, 16, (u8*) ptr);
|
||||
}
|
||||
|
||||
void OLED_BlankSlot(uint8_t xStart, uint8_t width) {
|
||||
u8* ptr = (u8*) FONT;
|
||||
ptr += (36) * (FONT_WIDTH * 2);
|
||||
|
||||
Oled_DrawArea(xStart, 0, width, 16, (u8*) ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Draw a 2 digit number to the display at letter slot x
|
||||
*/
|
||||
@@ -254,3 +262,7 @@ void OLED_DrawIDLELogo() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void OLED_DrawSymbol(uint8_t x, uint8_t symbol) {
|
||||
Oled_DrawArea(x * FONT_WIDTH, 0, 16, 16, SymbolTable + (symbol * 32));
|
||||
}
|
||||
|
||||
@@ -52,5 +52,6 @@ void resetSettings() {
|
||||
systemSettings.sensitivity=0x00; //Default high sensitivity
|
||||
systemSettings.tempCalibration=239; //Default to their calibration value
|
||||
systemSettings.voltageDiv=144; //Default divider from schematic
|
||||
systemSettings.ShutdownTime=30;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user