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