we are trying to make analog keyboard . We have installed an IR Sensor beneath a key and are able to receive analog values in arduino micro . We wanted to know how can we use these analog values to interface with a game?
We wanted to know how can we use these analog values to interface with a game?
Which game? Poker? I really can't see how the analog value(s) would be useful.
What about a racing game? Pressure sensitive keys will allow you to increase/decrease speed depending on the pressure applied to the key.
Another is maybe a pinball game. We all tend to hit the button/paddle harder in order to hit the ball harder, don't we?
yeah we are trying to control a racing game . We are getting analog values by serial communication in arduino micro . I have read about keystrokes . But how can I send analog value and control the game?
You might not be able to use just the keystroke and value as one, so you might need to first send the key then the value after it and make sure you get both.
Or you could probably send a Struct composed of the key and value, then on the receiving side split them up to their appropriate places. I never tried it before, but it should work.
Are you using the Keyboard library, because I didn't know it was compatible with an Arduino Micro.
rishab: how can I send analog value and control the game?
I think you would need to understand what feature of the game you wanted to be controlled by the analog input, work out how that feature would normally be controlled using a standard keyboard, and program your Arduino to emit the corresponding key sequence appropriate to the current analog input value. This sounds like something that would be inherently game-specific, unless you are emulating a keyboard that already has some form of analog input as standard (I don't know of anything like that). I think the closest would be a controller that consists of a joystick as well as / instead of a keyboard.