For brains, look under the videos there are a good example.
For pokeys, it is a hardware piece normally cheap that can handle several inputs and outputs, including 5, if I am not in mistake, analog inputs.
Start with the pokeys to see if you can read the analog inputs. It is quite easy, then write the brains.