Updated 15/04/2021 – insertion point revised for v2021-04-07-01 ino file
Project Update December 2020
VK4GHZ Nextion for K3NG Rotator Controller firmware v 2020-12-17-01 update brings “User Defined Function” buttons for those wanting to experiment with triggering their own custom code.
Buttons on new Nextion page “User Defined Functions” will send upon a long touch to the MCU;
\?U1
\?U2
\?U3
\?U4
Custom code can be inserted into your k3ng_rotator_controller.ino file to react to these buttons presses.
Example 1 – UDF button 1
Toggle azimuth slow start & slow down
if ((input_buffer[2] == ‘U’) && (input_buffer[3] == ‘1’)) { // \?U1 – User 1 Defined
az_slowstart_active =!az_slowstart_active;
az_slowdown_active =!az_slowdown_active;
strconditionalcpy(return_string, “\\!OKU1”, include_response_code);
}Example 2 – UDF button 2
Toggle elevation slow start & slow downif ((input_buffer[2] == ‘U’) && (input_buffer[3] == ‘2’)) { // \?U2 – User 2 Defined
el_slowstart_active = !el_slowstart_active;
el_slowdown_active = !el_slowdown_active;
strconditionalcpy(return_string, “\\!OKU2”, include_response_code);
}
As of Arduino code version 2021.04.07.01, these custom code lines would be inserted around line 15545, just before the rotate left command;
For more information – see the video
Kits available