Skip to content

Commit

Permalink
Import up/down indicator from miniware
Browse files Browse the repository at this point in the history
Closes #3 with nicer heating display
  • Loading branch information
Ralim committed May 21, 2017
1 parent 67e3c44 commit cb5d4bc
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 17 deletions.
26 changes: 26 additions & 0 deletions workspace/ts100/inc/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
2 changes: 2 additions & 0 deletions workspace/ts100/inc/Oled.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *********************************/
2 changes: 1 addition & 1 deletion workspace/ts100/src/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.06", 8); //
delayMs(800); //Pause to show version number
Start_Watchdog(1000); //start the system watch dog as 1 second timeout
}
34 changes: 18 additions & 16 deletions workspace/ts100/src/Modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,41 +281,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
{
drawTemp(temp, 0);
OLED_DrawChar(' ', 3);

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_DrawChar('C', 5);
OLED_DrawSymbol(6, 5);
} else {
if (getIronTimer() < 900) {
OLED_DrawChar(' ', 5);
OLED_DrawSymbol(6, 7);
} else { //we are heating
OLED_DrawChar('H', 5);
//OLED_DrawChar('H', 5);
OLED_DrawSymbol(6, 6);
}
}
drawTemp(temp, 0);
OLED_DrawChar(' ', 3);
OLED_DrawChar(' ', 4);
OLED_DrawChar(' ', 6);
OLED_DrawChar(' ', 7);

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
Expand Down Expand Up @@ -383,7 +385,7 @@ void DrawUI() {
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:
Expand Down
12 changes: 12 additions & 0 deletions workspace/ts100/src/Oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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));
}

0 comments on commit cb5d4bc

Please sign in to comment.