Programming 2 joysticks - Raspberry Pi Forums
i have made program , can't read 2 joysticks separately. have verified both joysticks work fine separately read 1 joystick when used together.
or using teensy , loading code through teensyduino
code: select all
void loop() { // read analog inputs , set x-y position joystick.x(analogread(0)); joystick.y(analogread(1)); joystick.x(analogread(2)); joystick.y(analogread(3));
code: select all
void loop() { // read analog inputs , set x-y position joystick.x(1, analogread(0)); joystick.y(1, analogread(1)); joystick.x(2, analogread(2)); joystick.y(2, analogread(3));
i don't know library using, looks need instantiate 2 joystick objects, not one.
right now, code read channels 0 & 1, overwrite x , y when reading channels 2 & 3
don't know if second listing should work, not familiar joystick object.
right now, code read channels 0 & 1, overwrite x , y when reading channels 2 & 3
don't know if second listing should work, not familiar joystick object.
raspigamer wrote:i have made program , can't read 2 joysticks separately. have verified both joysticks work fine separately read 1 joystick when used together.
orcode: select all
void loop() { // read analog inputs , set x-y position joystick.x(analogread(0)); joystick.y(analogread(1)); joystick.x(analogread(2)); joystick.y(analogread(3));
using teensy , loading code through teensyduinocode: select all
void loop() { // read analog inputs , set x-y position joystick.x(1, analogread(0)); joystick.y(1, analogread(1)); joystick.x(2, analogread(2)); joystick.y(2, analogread(3));
raspberrypi
Comments
Post a Comment