From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you get positional information from boolean arrays

Ok, I had to build this to try it. It yields a software answer not unlike an old multi-frequency keyscan matrix. But what are some cases where this is more useful than the button clustered version included in the attached project?

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
0 Kudos
Message 11 of 31
(2,588 Views)

Maybe this will give you some ideas.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 31
(2,562 Views)

Thanks, I'll try this...

0 Kudos
Message 13 of 31
(2,513 Views)

Sorry, doing a bit more reading of the responces.

 

What we are trying to do is to represent a soccer net on the front panel by a series of boolean buttons arranged into an array.

 

We are using this to control a soccer ball kicking machine and we want to "aim" the ball by pressing a button on the front screen.

 

for example, if you wanted to shoot the ball to the top left corner of the new you would press the top left button in the array.

 

We need the x,y coordinates of the button in the array to tell the linear actuator where to move to.

 

Basically the top left corner might be correlating to x= -500, y= 300 for example.  these being the stepper motor count to direct the actuator to move that much in that direction....

 

hope this clears it up a bit....

0 Kudos
Message 14 of 31
(2,508 Views)

Array indices are never negative, so you simply need to do a linear remapping to the desired coordinate system.

 

You could also use a 2D picture and get the clicked image coordinates from a mouse-down event.

(You could even use a picture of a real goal. :D)

0 Kudos
Message 15 of 31
(2,494 Views)

Whatever you have to do to convert the array location to an actual physical coordinates that fires a ball to a target location is up to you to do.  We don't know how big your goal is, how many "elements" you want to break it into or how far the "ball kicker" is from it.  Time to do a little math... Smiley Wink

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 16 of 31
(2,486 Views)

Thanks for letting me know what you are doing with this code. I really like to picture what physical things people are after with code. I don't enjoy classroom theory all that much. Happily I don't have to mess with theory very often and get to live in the real world these days. Adding two linear actuators to move your buttons on the x and y planes would make for some interesting code as you worked on differing angles and distances to hit the spot you desire. This would be more realistic as the "player" moves around on the field.

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
0 Kudos
Message 17 of 31
(2,481 Views)

 

 

 

Hello,

 

You may want to try this, Coordinates 0,0 would be at your bottom left. I have too approaches with a for loop and an index function so that you can see both methods. Open the VI and explore, needed to do some logic to translate to coordinate system for your app.

 

Hope it works,

 

God Bless

 

bool array.png

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding. Proverbs 4:7
Message 18 of 31
(2,472 Views)

@altenbach wrote:

You could also use a 2D picture and get the clicked image coordinates from a mouse-down event.

(You could even use a picture of a real goal. :D)


Here's a quick implementation to give you some ideas. Modify as needed.

 

Download All
Message 19 of 31
(2,459 Views)

Wow, thats very nice and simple, I might add..... Altenback

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding. Proverbs 4:7
0 Kudos
Message 20 of 31
(2,443 Views)