I´m trying to use these ph calibration code, but instead of inserting via serial the "CALIBRATION" or "EXIT" or "ACID:xx" or "ALKALI:xx" commands, what i want is to insert these commands with buttons, if i press button 1 , it enters "CALIBRATION" command, if i press button 2 it inserts predefined "ACID: 4.0" command....
The button libraries is not a problem for me, but i don´t know how to simulate the manual introduction of the commands in the serial with buttons.
I reckon if you create an equivalent function that produces the same output when a button is pressed and call it like this
byte modeIndex = getKeypadValueConvertedToMode();
you will get the same functionality.
if you want to be able to use Serial and the keypad in the same program things will be a little more complex because you will need code to decide which to use.
if you want to be able to use Serial and the keypad in the same program things will be a little more complex because you will need code to decide which to use.
I don't see why anything like that would be necessary. If the "acid" switch is pressed, the code that detects that could simply set receivedBuffer to "ACID:xx" (where xx is the appropriate value), and then call uartParse() and do the same thing(s) with the return value that the current code does.
PaulS:
I don't see why anything like that would be necessary. If the "acid" switch is pressed, the code that detects that could simply set receivedBuffer to "ACID:xx" (where xx is the appropriate value), and then call uartParse() and do the same thing(s) with the return value that the current code does.
But what happens if a message also arrives by Serial?