I am trying to receive input from joystick. After input has been received sound should be generated. This works, but it responds to both push and release of buttons of the joystick. How do I get it to respond to only pushes and not releases.
More so, How do I get the event listener to respond to 180 degree movements of the joystick. Currently when I move the joystick it continues generating sound, even long after I have released it
Hid myHid;
HidMsg msg;
0=>int device;
if(!myHid.openJoystick(device)){
<<<"Couldn't">>>;
me.exit();
}
<<<"Ready">>>;
SndBuf coin=>dac;
0.6=>coin.gain;
0=>coin.pos;
while(1){
myHid=>now;
while(myHid.recv(msg)){
<<<"Rev">>>;
me.dir()+"/audio/smw_jump.wav"=> coin.read;
.2::second=>now;
}
}