Skip to content

Commit 6f3a065

Browse files
committed
better printer logic
1 parent 87eb469 commit 6f3a065

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

.vscode/settings.json

Whitespace-only changes.

fossa/fossa.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "hardcoded_user_config.h"
3232

3333
bool hardcoded = HARDCODED; // set to true if you want to use the above hardcoded settings
34-
bool printerBool = PRINTER;
34+
bool printerBool = false;
3535
int billAmountInt[10];
3636
float coinAmountFloat[6];
3737

@@ -116,11 +116,12 @@ void setup() {
116116
// initialize bill and coin acceptor
117117
SerialPort1.begin(300, SERIAL_8N2, BILL_TX, BILL_RX);
118118
SerialPort2.begin(4800, SERIAL_8N1, COIN_TX);
119+
printerSerial.begin(9600);
119120
pinMode(COIN_INHIBIT, OUTPUT);
120121

121122
// initialize printer
122-
if(printerBool == true){
123-
printerSerial.begin(9600);
123+
if (printerSerial.available()) {
124+
printerBool = true;
124125
printer.begin();
125126
}
126127
}

fossa/hardcoded_user_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// If using hardcoded options 'cp fossa/hardcoded_user_config.h.example fossa/hardcoded_user_config.h',
22
// then change the values on fossa/hardcoded_user_config.h
3-
#define PRINTER false // true or false
43

54
#define HARDCODED false // true to use settings below
5+
66
#define LANGUAGE "en" // Supports en, es, fr, de, it, pt, pl, hu, tr, ro, fi, sv
77
#define CHARGE 5 // % You will charge people for service, set in LNbits extension
88
#define MAX_AMOUNT 30 // Max amount per withdraw

versions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"esp32"
55
],
66
"versions": [
7-
"v0.4.1",
8-
"v0.4.1"
7+
"v0.4.2"
98
]
109
}

0 commit comments

Comments
 (0)