ok.. firstly allow me to explain what i am attempting, in short a simple typewriter system that uses shift registers to detect if the incomming signal is a 1 or 0, which is then transfered to the arduino (note i know there will be an easier and much more economic way of doing this, im a newbie, learning and trying)
anyway, i have an arduino script which currently works, it takes the reading from the shift register and prints it on the lcd screen that is on the same system. so i end up with a row of binary numbers
now what i am wanting to do, is set different values for each of those binary numbers, for example
00000001 = yes
00000010 = no
00000100 = maybe
etc, now I know there is a code that you can use as a form of lookup table, just cant find any resource for it, any help would be appreciated.
the outcome - Instead of printing 00000001 on the lcd screen, i want the word Yes instead.
etc
etc
Thank you for your help, a link or even assistance will help no end, thank you for your time
Most simple computer algorithms just duplicate "what you would do". Except that the human mind does a lot of things by habit, you need to slow down a bit and understand what you are doing. Then you can code it fairly easily.
First, forget about the computer and imagine your target, a lookup table (columns of number). Ask yourself, how you would perform a lookup...
start at the top
is the first number the one you are looking for? Yes - look across to the next column and there is your value. No - try next number
look at the next number
Reach the end? Then the lookup failed - not found, must be out of range.