Finished some missing comment lines.
This commit is contained in:
@@ -54,8 +54,8 @@ SoftwareSerial mySerial(BLUE_RX, BLUE_TX); // Start file descriptor and assign p
|
||||
|
||||
|
||||
// Macros --------------------------------------------------------
|
||||
#define rLEFT digitalRead(LEFT) // Read button Left
|
||||
#define rRIGHT digitalRead(RIGHT) // Read button Right
|
||||
#define rLEFT digitalRead(LEFT) // Read button Left
|
||||
#define rRIGHT digitalRead(RIGHT) // Read button Right
|
||||
#define rACT digitalRead(ACT) // Read button Action
|
||||
//----------------------------------------------------------------
|
||||
|
||||
@@ -141,48 +141,45 @@ void setup()
|
||||
// Timer compare interrupt service routine --
|
||||
ISR(TIMER1_COMPA_vect)
|
||||
{
|
||||
menuState(); // Read buttons act accordingly and update menus
|
||||
if (amp_pin(i_load) > curr_limit) // If load current more then current limit
|
||||
menuState(); // Read buttons act accordingly and update menus
|
||||
if (amp_pin(i_load) > curr_limit) // If load current more then current limit
|
||||
{
|
||||
load_status = off; // Turn off load
|
||||
load_status = off; // Turn off load
|
||||
}
|
||||
digitalWrite(load_line, load_status); // Turn load on or off depending on the load_status
|
||||
|
||||
|
||||
|
||||
|
||||
if (mySerial.available()) {
|
||||
ble_data = mySerial.read();
|
||||
// Serial.write(mySerial.read()); // For debug only
|
||||
switch(ble_data)
|
||||
if (mySerial.available()) { // If there is incoming serial data
|
||||
ble_data = mySerial.read(); // save it caracter into ble_data
|
||||
switch(ble_data) // Evaluate caracter
|
||||
{
|
||||
case 'a':
|
||||
dtostrf(parameters[battery_volt], 5, 2, outstr);
|
||||
mySerial.write(outstr);
|
||||
break;
|
||||
case 'a': // If caracter is 'a'
|
||||
dtostrf(parameters[battery_volt], 5, 2, outstr); // convert battery voltage to string
|
||||
mySerial.write(outstr); // and send it to bluetooth
|
||||
break; // finish switch statment
|
||||
|
||||
case 'b':
|
||||
dtostrf(parameters[voltage_1], 5, 2, outstr);
|
||||
mySerial.write(outstr);
|
||||
break;
|
||||
case 'b': // If caracter is 'b'
|
||||
dtostrf(parameters[voltage_1], 5, 2, outstr); // convert voltage 1 to string
|
||||
mySerial.write(outstr); // and send it to bluetooth
|
||||
break; // finish switch statment
|
||||
|
||||
case 'c':
|
||||
dtostrf(parameters[voltage_2], 5, 2, outstr);
|
||||
mySerial.write(outstr);
|
||||
break;
|
||||
case 'c': // If caracter is 'c'
|
||||
dtostrf(parameters[voltage_2], 5, 2, outstr); // convert voltage 2 to string
|
||||
mySerial.write(outstr); // and send it to bluetooth
|
||||
break; // finish switch statment
|
||||
|
||||
case 'd':
|
||||
dtostrf(parameters[curr], 5, 2, outstr);
|
||||
mySerial.write(outstr);
|
||||
break;
|
||||
case 'd': // If caracter is 'd'
|
||||
dtostrf(parameters[curr], 5, 2, outstr); // convert load current to string
|
||||
mySerial.write(outstr); // and send it to bluetooth
|
||||
break; // finish switch statment
|
||||
|
||||
case 'e':
|
||||
load_status = on;
|
||||
break;
|
||||
case 'e': // If caracter is 'd'
|
||||
load_status = on; // turn ON load
|
||||
break; // finish switch statment
|
||||
|
||||
case 'f':
|
||||
load_status = off;
|
||||
break;
|
||||
case 'f': // If caracter is 'f'
|
||||
load_status = off; // turn OFF load
|
||||
break; // finish switch statment
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user