10-15-2015 03:43 PM
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?
10-16-2015 12:08 PM - edited 10-16-2015 12:09 PM
Maybe this will give you some ideas.
10-23-2015 01:35 PM
Thanks, I'll try this...
10-23-2015 01:45 PM
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....
10-23-2015 02:28 PM - edited 10-23-2015 02:28 PM
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)
10-23-2015 02:33 PM
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...
10-23-2015 02:39 PM
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.
10-23-2015 02:49 PM
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
10-23-2015 03:03 PM - edited 10-23-2015 03:04 PM
@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.
10-23-2015 03:10 PM
Wow, thats very nice and simple, I might add..... Altenback