uniconfig.h custom buttons
I would like to add some custom buttons.
1. Button that starts autolevel
2. Button that turns the CASE_LIGHTS_PIN on
3. Button that executes a particular gcode file (not just recently seleced)
I have looked at the long list of options at top of ui.h but I just don't see how to do it.
Comments
uint8_t Printer::moveToReal(float x,float y,float z,float e,float f,bool pathOptimize = true);
Set coordinates to IGNORE_COORDINATE it you do not want to change.
One button can only have one function. What you want in this case is a wizard where you switch between wizard pages with "ok" and action is bound to ok. But that is a bit more difficult to program and requires some programming skills to understand the flow. See filament change for an example.
since I use zprobe autoleveling instead of software leveling, I was able to repurpose setp1-setp3. in hindsight, I probably could have left the prev code in place alongside what I have below and it still would have worked.
I also made a P123_RESET UI_ACTION to change all my probe points back to normal. I know I could use the code from M502, but too many other things in the eeprom also get reset with that, and it's not always convenient. If I wasn't so lazy I would figure out how to make space in the eeprom and store the original data there, that way these values wouldn't have to manually adjusted for each persons printer.
-------------
case UI_ACTION_SET_P1SA:
Having a button that resets that "Printing time" and "Filament Printed" counters on the LCD has come in handy. I press it before starting a print and I get accurate counts for that print. The counter for a print usually goes away as soon as it finishes, and I don't usually keep my repetier host connected to monitor the time. Nor can I be relied upon to write down or remember the time a print starts (or notice when it finishes). But I can press a button. ...
Z-Probe Servo Deploy and Retract buttons. Is there a a way to have it toggle between these two function on one button?
case UI_ACTION_ZPROBE_DEPLOY:
boolean flag= FALSE ; // at beginning of your custom events, must be global defined
case x:
if(!flag) {
action = action1;
flag= TRUE;
}
else{
action = action2;
flag= FALSE;
}
break;
something like this should work