3232
3333bool hardcoded = HARDCODED ; // set to true if you want to use the above hardcoded settings
3434bool printerBool = false ;
35- int billAmountInt [10 ];
36- float coinAmountFloat[6 ];
35+ float billAmountFloat [10 ];
36+ float coinAmountFloat[10 ];
3737
3838// /////////////////////////////////////////////////
3939// /////////////////////////////////////////////////
@@ -60,7 +60,7 @@ int maxBeforeResetTally;
6060int bills;
6161float coins;
6262float total;
63- int billAmountSize = sizeof (billAmountInt ) / sizeof (int );
63+ float billAmountSize = sizeof (billAmountFloat ) / sizeof (float );
6464float coinAmountSize = sizeof (coinAmountFloat) / sizeof (float );
6565int moneyTimer = 0 ;
6666bool waitForTap = true ;
@@ -92,6 +92,7 @@ void setup() {
9292 tft.setRotation (1 );
9393 tft.invertDisplay (false );
9494 printMessage (" " , " Loading.." , " " , TFT_WHITE , TFT_BLACK );
95+ printMessage (" " , " Loading.." , " " , TFT_BLACK , TFT_WHITE );
9596
9697 // wait few secods for tap to start config mode
9798 while (waitForTap && total < 100 ) {
@@ -117,21 +118,6 @@ void setup() {
117118 SerialPort1.begin (300 , SERIAL_8N2 , BILL_TX , BILL_RX );
118119 SerialPort2.begin (4800 , SERIAL_8N1 , COIN_TX );
119120 printerSerial.begin (9600 );
120- printer.begin ();
121- printer.wake ();
122- printer.setDefault ();
123- printer.justify (' C' );
124- printer.feed (3 );
125- printer.boldOn ();
126- printer.setSize (' L' );
127- printer.println (" Printer Connected :)" );
128- printer.println (" " );
129- printer.println (" " );
130- printer.println (" " );
131- printer.println (" " );
132- printer.println (" " );
133- printer.sleep ();
134-
135121 pinMode (COIN_INHIBIT , OUTPUT );
136122}
137123
@@ -153,10 +139,10 @@ void loop() {
153139 Serial.println (" Coin acceptor connected" );
154140 }
155141 moneyTimerFun ();
156- Serial.println (total);
157- Serial.println (maxBeforeResetTally);
142+ Serial.println (" total" + String (total) );
143+ Serial.println (" maxBeforeResetTally" + String (maxBeforeResetTally) );
158144 maxBeforeResetTally = maxBeforeResetTally + (total / 100 );
159- Serial.println (maxBeforeResetTally);
145+ Serial.println (" maxBeforeResetTally" + String (maxBeforeResetTally) );
160146 makeLNURL ();
161147 qrShowCodeLNURL (scanMeT);
162148 }
@@ -180,9 +166,9 @@ void moneyTimerFun() {
180166 int x = SerialPort1.read ();
181167 for (int i = 0 ; i < billAmountSize; i++) {
182168 if ((i + 1 ) == x) {
183- bills = bills + billAmountInt [i];
169+ bills = bills + billAmountFloat [i];
184170 total = (coins + bills);
185- printMessage (billAmountInt [i] + currencyATM, totalT + String (total) + currencyATM, tapScreenT, TFT_WHITE , TFT_BLACK );
171+ printMessage (billAmountFloat [i] + currencyATM, totalT + String (total) + currencyATM, tapScreenT, TFT_WHITE , TFT_BLACK );
186172 }
187173 }
188174 }
0 commit comments