Hey guys, I am needing some help. I am trying to use a Potentiometer (And later some buttons and probably more pots) to control a game. (This is kind-of an offshoot of this forum that I made, but I have figured out some different stuff and a lot has changed. VJoy uses channels and the Serial port (USB) to simulate a controller, which is exactly what I need and I have verified that it works in my game. The question is, how do I create channels that VJoy will listen to when I turn the Potentiometer? Right now, I have the potentiometer putting out values in byte
form, I'm not sure if that would be correct or not.. I need some help here. Any tips are probably useful, and an answer to the channels thing would be preferable and amazing. Thank you so much!!!
(Just for reference, I am outputting the amount with this function:
byt potAmt = byte(analogRead(pot));
Given that the potentiometer has been defined as pot
.)
Analogread will give a 10 bit value.
If you cast to 8 bit size you will loose the 2 most significant bits.
Maybe better do a bitshift before the cast and loose the least significant bits
byte val = byte((analogRead(pin)>>2);
By the way, it is completely unclear how you plan to send your reading to the PC...
Is there any code yet?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.