Shop OBEX P1 Docs P2 Docs Learn Events
x-y array comparison — Parallax Forums

x-y array comparison

SILVER777SILVER777 Posts: 13
edited 2008-07-31 18:11 in BASIC Stamp
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.
965 x 1033 - 134K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-30 15:34
    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
  • SILVER777SILVER777 Posts: 13
    edited 2008-07-31 12:40
    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.
  • SILVER777SILVER777 Posts: 13
    edited 2008-07-31 18:11
    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?
    965 x 1033 - 132K
Sign In or Register to comment.