PDA

View Full Version : x-y array comparison



SILVER777
07-30-2008, 11:25 PM
Hey all,

I've got a circuit that will send me a series of 1's and 0's in an x-y array. How would I write the·code to have the bs2px compare the information from x and y and tell me where at in the x-y array a 1 occurred?

Thank you in advance

oh and here's the circuit to look at just to have a visual to reference. keep in mind that 555 timer is going to be replace with the parallax by a clock pulse out.

Mike Green
07-30-2008, 11:34 PM
There have been several articles in the Nuts and Volts Columns series on scanning keyboards. What you're asking is very similar.
Have a look through the columns: www.parallax.com/Resources/NutsVoltsColumns/tabid/272/Default.aspx (http://www.parallax.com/Resources/NutsVoltsColumns/tabid/272/Default.aspx)

SILVER777
07-31-2008, 08:40 PM
Sadly I'm not seeing the keyboard article. I found "where's waldo?" but I'm not sure how to take the information from that and apply it here.

SILVER777
08-01-2008, 02:11 AM
Ok, so all I really need this thing to do is be able to look at 2 inputs, compare the two of them and then give me a decimal number output. Basically if there is a 1 on an x-y array it will decipher where at in x that one is and where at the 1 is on the y axis. Then be able to multiply the two numbers together.

Just·like we all used to do in elementary when learning our multiplication tables. we used to take one number then follow the second number on the opposite side of the table then meet the two points together and it gave us the answer of both of those numbers multiplied together.

In my schematic you can see the diode array, eventually there will be a logic 1 at one of those points. when that happens it will send a series of ones and zeros to the 4021's it will then send out that series to the bs2px24 on an input pin. one input (for this example we'll call it pin 1)·will be designated as the x-axis and one will be designated as the y-axis (for this example we'll call it pin 2). So if a logic 1 appears as it's shown on the attached diagram, pin 1 will·read 00100 and pin two will read 10000.



Any ideas???? Am I·going·about this all wrong???? Can the parallax even attempt this?