LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

flash games

Hi all,

I have a motion sensor acquiring realtime values in labview.
I want to send this in realtime to control an object in a flash game
Pls advice me on this. Thanks.

0 Kudos
Message 1 of 11
(4,069 Views)

What exactly do you want to do? Move the mouse? Click? Hit the keyboard?

0 Kudos
Message 2 of 11
(4,020 Views)

I can imagine you can control the flash game using your keyboard, yes?

If so, it is easy to programmatically fire key strokes, like the up/down/left/right keys:

https://decibel.ni.com/content/docs/DOC-9001

You just need to create a DAQ loop which lets say gets the motion sensor values with 10 Hz. After this you need to translate the motion sensor values into direction info, like the up/down/left/right. From this loop you can then fire the appropriate library call to simulate the key stroke on your keyboard...

 

You could do something similar with mouse, try to google for it...

0 Kudos
Message 3 of 11
(4,009 Views)

Just to give you an idea, test it here for example: http://www.newgrounds.com/portal/view/578636

 

Example_VI_BD_keystroke.png

 

edit: there is a little bug in the VI, obviously you need to multiply by 3 NOT 4! 🙂 (array indexes are from 0 to 3!)

0 Kudos
Message 4 of 11
(4,003 Views)

Hi Blokk,

 

there is a little bug in the VI, obviously you need to multiply by 3 NOT 4! Smiley Happy (array indexes are from 0 to 3!)

Yes, there's a bug!

 

To get a uniform "noise" (aka random values) you should multiply by 4 (four), followed by "Round To -Inf" to ensure proper values of 0-3…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 11
(3,980 Views)

Yes, I know 🙂 I remembered one post where this was discussed:

http://forums.ni.com/t5/LabVIEW/How-do-I-generate-a-random-integer-from-1-5/m-p/1056546/highlight/tr...

 

However, the question how to generate uniform random numbers is totally unrelevant for this VI which was only made for demonstration purpose 😉

0 Kudos
Message 6 of 11
(3,970 Views)

Hi... Thanks for replying.

 

I want to move a ball in four directions... (flash)

I have a sensor attached to my hand ... that reads whether i am moving the hand left / right/ top / bottom.. (labview)

How can i transfer the information from labview to flash....

 

 

0 Kudos
Message 7 of 11
(3,937 Views)
Is the flash app developed by you, or someone else? You can see my example above how to do it simulating keyboard strokes.
0 Kudos
Message 8 of 11
(3,932 Views)

we have not started developing the flash app... 

we want to know the way to communicate between labview and flash app

0 Kudos
Message 9 of 11
(3,929 Views)

can i know what library we have to use for this ?

0 Kudos
Message 10 of 11
(3,927 Views)