Thanks mate,
I thought it might have been clearing and re-writing to the display all the time,
i found that if i press all 3 buttons at once, the display becomes solid and is nice and readable, so i guess i am locking something up doing that... i'll only ever press one button at a time in my finished design anyway.
Unfortunately this is all new to me, i just found some code on the net, and it kind of does what i want... but i need to modify it for my own use now,
Not sure i need to check the message is already displayed before writing to the display? as if it is, it will just flash once when it is updated???
the goal is definately to only write to the display when something changes, either a 'ticket' selection button, the canel button 'clear display' or print ticket : display 'printing' then clear display,
So, i assume i need to scan all inputs for changes, detect an input, check if the button pressed has a lcd function assigned to it, if so, either write that message on the lcd, clear the display or display the 'printing' message, wait 2 seconds, then clear the display,
I have slightly modified the keypad sketch to work with my button matrix :
#include <Keypad.h>
const byte ROWS = 4; //4 rows
const byte COLS = 9; //9 columns
//define the symbols on the buttons of the keypads, Ideally i want the real keys, i.e. 'Fahrschein Nor', 'Kurzstrecke', 'Ausgabe' etc,
//but the hexakeys thing i think only reads/displays the last letter.
char hexaKeys[ROWS][COLS] = {
{'0','1','2','3','4','5','6','7','8'},
{'9','A','B','C','D','E','F','G','H'},
{'I','J','K','L','M','N','O','P','Q'},
{'R','S','T','U','V','W','X','Y','Z'}
};
byte rowPins[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {12, 11, 10, 9, 8, 7, 6, 5, 4}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad cusomKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
void setup(){
Serial.begin(9600);
}
void loop(){
char customKey = cusomKeypad.getKey();
if (customKey != NO_KEY){
Serial.println(customKey);
}
}
i wonder if i could alter the bit where it sends the charecters to serial, to send them to the lcd, and assign text to be displayd instead of just the button assignment number/letters,