I have used ardunio'a in the past for several model railway projects driving relays and servos. So far so good however this time I would like to use a 4x4 keypad to switch servos and or relays. I can get 4x4 matrix to work but how do I then call a servo / relay function ?
Nothing complex to start the envisaged test been 5 relays with three relays activated with 3 of the servos. I know i could use separate switches but would to prefer to learn how to use a keyboard as future projects may involve multiple servos
You need to post your code so we can see where you have got to.
And please use the code button </> so your code looks like this and is easy to copy to a text editor
In simple terms, the keypad will allow you to enter and save a number in a variable.
The functions that move your relays and servos can check the value of that variable to decide whether it is their turn to work.
Personally I would avoid keypads for controlling a model railway. I like simple switches or a graphic on a PC screen or a phone. That way I don't have to remember numbers.