madsci1016 / Arduino-PS2X

Read a Playstation 2 Gamepad or Guitar Hero Controller using an Arduino
http://www.billporter.info/playstation-2-controller-arduino-library-v1-0/
366 stars 213 forks source link

Joysticks ohne Funktion ? #37

Open DK0975 opened 1 year ago

DK0975 commented 1 year ago

Hallo. Ich habe einen PS2 Wireless Controller genauso angeschlossen wie es für das Beispiel erforderlich ist. Alles mehrfach kontrolliert. Im seriellen Monitor kommt bei allen Tasten eine Ausgabebestätigung. Beim drücken der Joysticks kommt die Meldung da R3, bzw. L3 gedrückt wurde. Beim betätigen der Joysticks in X oder Y (egal ob rechts oder links) kommt im seriellen Monitor keine Ausgabe. Woran könnte das liegen ?

SerEpicPanda commented 1 year ago

Just checking that you are holding R1 or L1 to print the values as is in the example?

DK0975 commented 1 year ago

Beim drücken von L1 oder R1 bekomme ich Werte (weiß aber jetzt nicht welche).

SerEpicPanda commented 1 year ago

In this bit of code it shows which values are printed whilst R1 or L1 are pressed. In this case LY, LX, RY, RX. you could add labels in the print statements to make it clearer.

if(ps2x.Button(PSB_L1) || ps2x.Button(PSB_R1)) { //print stick values if either is TRUE Serial.print("Stick Values:"); Serial.print(ps2x.Analog(PSS_LY), DEC); //Left stick, Y axis. Other options: LX, RY, RX Serial.print(","); Serial.print(ps2x.Analog(PSS_LX), DEC); Serial.print(","); Serial.print(ps2x.Analog(PSS_RY), DEC); Serial.print(","); Serial.println(ps2x.Analog(PSS_RX), DEC); }

DK0975 commented 1 year ago

Okay. Es funktioniert. Vielen Dank für die Hilfe. Das ist ja eine UND-Funktion von R1(L1) mit dem jeweiligen Stick. Schade das die Joysticks nicht separat genutzt werden können.