To add additional buttons in UA,
Identify button pins (more on this below)
Modify readButtons in upa.cpp setup bits correctly using BUTTON_UP, BUTTON_DOWN etc as bit position
and everything should work…But how would smoothie know that up, down and pause buttons signals are coming from panel.
or smoothie need not know, just fill in the button status byte.
Now to find free pins on uno (pin 0,1 free assuming bootloader serial is kicked out) or reuse buzzer and led, led2 pins
Assuming we reuse buzzer and led pins, in this case disable buzzer in config.
How to disable panel LEDs?
Imported from wikidot
got the additional buttons…just in case anybody lands up here….
Modify upa.cpp in the arduino Universal Adapter files
static byte readButtons()
{
#ifdef VIKI
return lcd.readButtons();
#elif defined(PARALLEL)
byte stat = digitalReadFast(CLICK_PIN) == LOW ? 0x01 : 0x00; //BUTTON_SELECT 0x01 bit 0
digitalReadFast(DOWN_PIN) == LOW ? stat |= 4 : stat &= 251; //BUTTON_DOWN 0x04 bit 2
digitalReadFast(UP_PIN) == LOW ? stat |= 8 : stat &= 247; //BUTTON_UP 0x08 bit 3
digitalReadFast(LEFT_PIN)== LOW ? stat |= 16 : stat &= 239; //BUTTON_LEFT 0x10 bit 4
//BUTTON_RIGHT 0x02 bit 1
//BUTTON_PAUSE 0x20 bit 5
return stat;
#endif
}
Where UP, DOWN,LEFT pins are free pins on uno… also initialize them as input with proper pull up.