Skip to content

Commit eb3ae10

Browse files
committed
added back docs folder
1 parent 6db8fff commit eb3ae10

9 files changed

+268
-12
lines changed

docs/Hardware_Layout.drawio

+244
Large diffs are not rendered by default.

docs/Operation_Instructions.docx

24 KB
Binary file not shown.

docs/images/schematic.png

149 KB
Loading

src/calibrate.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "calibrate.h"
22
#include "e3_core.h"
33

4-
const char PASSWORD[5] = "1234";
4+
const char PASSWORD[5] = CALIBRATION_PASSWORD;
55
int LOCKED = 1;
66

77
#define CHARMAP_SIZE 8
@@ -126,10 +126,16 @@ void calibrate_lock()
126126
else if (c == ENTER)
127127
{
128128
handleEnter_lock();
129+
if (LOCKED)
130+
{
131+
incorrectPasswordScreen();
132+
delay(1000);
133+
}
129134
return;
130135
}
131136
else if (c == CALIBRATE_BUTTON)
132137
{
138+
setValStr[0] = '\0';
133139
signal.error();
134140
return;
135141
}
@@ -150,8 +156,6 @@ void calibrate()
150156

151157
if (LOCKED)
152158
{
153-
incorrectPasswordScreen();
154-
delay(1000);
155159
curScreen = HOME;
156160
return;
157161
}

src/e3_memory.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
E3_Memory::E3_Memory()
55
{
6-
E3_Memory::readAll();
6+
readAll();
77
}
88

99
void E3_Memory::readAll()
@@ -12,6 +12,7 @@ void E3_Memory::readAll()
1212
EEPROM.get(fn1_addr, fn1);
1313
EEPROM.get(fn2_addr, fn2);
1414
EEPROM.get(fn3_addr, fn3);
15+
EEPROM.get(c_fact_addr, c_factor);
1516

1617
int size = 3;
1718
int arr[] = {fn1, fn2, fn3};
@@ -41,7 +42,7 @@ void E3_Memory::writeFN(int i, int val)
4142
{
4243
fn1 = val;
4344
#ifdef PERMANENT_MEM
44-
EEPROM.put(fn1_ad, fn1);
45+
EEPROM.put(fn1_addr, fn1);
4546
#endif
4647
}
4748
else if (i == 2)

src/main.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ void setup()
1818
screen.start();
1919
#endif
2020

21+
#ifndef INITIALIZE_PERMANENT_MEM
22+
memory.fn1 = 100;
23+
memory.fn2 = 200;
24+
memory.fn3 = 300;
25+
memory.c_factor = 464.5f;
26+
#endif
27+
2128
e3_scale.setVal = memory.fn1;
2229

2330
keypad.setDebounceTime(50);

src/main.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
#define HOME_KEYPAD_ENTER 1
77

88
//uncomment to toggle options on, leave commented for off
9-
#define NO_FOOTSWITCH
9+
#define PERMANENT_MEM
1010

11-
// #define PERMANENT_MEM
11+
#define INITIALIZE_PERMANENT_MEM
12+
13+
#define CALIBRATION_PASSWORD "1234"
1214

1315
// #define SERIAL_DEBUG
1416

@@ -20,6 +22,4 @@
2022

2123
#define VIRTUAL_DIGITAL
2224

23-
// #define CALIBRATE
24-
2525
#endif

src/preset.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ void updatePresetScreen()
55
{
66
char line[17];
77

8-
sprintf(line, "PREST:%c %7dg", curFNButton, memory.getFN(curFNButton - FN1_Button));
8+
sprintf(line, "PREST:%c %7dg", curFNButton, memory.getFN(curFNButton - FN1_Button + 1));
99

1010
screen.home();
1111
screen.print(line);
@@ -29,7 +29,7 @@ void handleFN_preset(char c)
2929

3030
void handleEnter_preset(char c)
3131
{
32-
e3_scale.setVal = memory.getFN(curFNButton - FN1_Button);
32+
e3_scale.setVal = memory.getFN(curFNButton - FN1_Button + 1);
3333

3434
curScreen = HOME;
3535
}

src/program.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void updateProgramScreen()
1515
screen.setCursor(0, 1);
1616
if (setValStr[0] == '\0')
1717
{
18-
snprintf(line, 17, "Cur Val:%7dg", memory.getFN(curFNButton - FN1_Button));
18+
snprintf(line, 17, "Cur Val:%7dg", memory.getFN(curFNButton - FN1_Button + 1));
1919
}
2020
else
2121
{

0 commit comments

Comments
 (0)