Hi
I need some help solving my HW problem.
I need to write a program in Labview where a ball is surrounded by four wall (XY with value 0-100). When the ball hit the wall it bounces back.
I started with a case structure and with a fixed XY position (say x=10,y=80) for simplicity. The x value will increase each time until it reaches 100. Once it reaches 100 it will start decreasing. But the problem is when it become 100 it is going to the true case structure and value is decrease by 1 (x value then 99). But again it goes to false case (as x<100) and value increased by one (x=100). So the ball bounces on the wall not moving forward.
How to overcome this problem. Attach is the snapshot of the block diagram.
Thanks.
I need some help solving my HW problem.
I need to write a program in Labview where a ball is surrounded by four wall (XY with value 0-100). When the ball hit the wall it bounces back.
I started with a case structure and with a fixed XY position (say x=10,y=80) for simplicity. The x value will increase each time until it reaches 100. Once it reaches 100 it will start decreasing. But the problem is when it become 100 it is going to the true case structure and value is decrease by 1 (x value then 99). But again it goes to false case (as x<100) and value increased by one (x=100). So the ball bounces on the wall not moving forward.
How to overcome this problem. Attach is the snapshot of the block diagram.
Thanks.
Attachments
-
182.4 KB Views: 95