Go Down

Topic: Lifebar, Getting health variables from PC game to arduino (Read 1 time) previous topic - next topic

Jul 04, 2013, 04:07 pm Last Edit: Jul 04, 2013, 04:19 pm by Criticalstone Reason: 1
I'm planning on building a lifebar like the one bfayer did here exept i will start with just LEDshttp://www.youtube.com/watch?v=ywfZsYApj_M

I can't figure out how to get the information from the game to the arduino. Should i save the variables to a text file or is there any way to "stream" the variables between the PC and arduino.

The game I'm going to use it mostly for is Minecraft which is a game based on java if that helps

Thank you in advance

PaulS

Quote
I can't figure out how to get the information from the game to the arduino.

If you don't have access to the source code, you can't. If you do, just send the data to the serial port that the Arduino is attached to.


How do i do this? with a simple java or c++ code?
Please give me an example of the syntax that will send this data to the serial port.

PaulS

Quote
Please give me an example of the syntax that will send this data to the serial port.

For Java? For C#? For PHP? For Python? For VB? For C++? Every language uses a different mechanism. The playground, in the "Interfacing with software" section has examples for every language.

Note that there is more to serial communication that just writing to the serial port. It needs to opened and closed properly, too.

I don't really understand what the examples on the playground mean.
Java is a pretty familiar language so an example in Java would be nice
Thank you for taking your time with a noob coder ^^

PaulS

There are examples on this page, along with full instructions:
http://playground.arduino.cc//Interfacing/Java

Go Up