BrickUp API Service for Docker version.

readJoystick.ino 659B

1234567891011121314151617181920212223242526
  1. #include <FR_Joystick.h>
  2. FR_Joystick js(A5,A4,A3,A2); //DCMotor Board
  3. //FR_Joystick js(12,2,A0,A1); //Servo Board
  4. void setup() {
  5. // put your setup code here, to run once:
  6. Serial.begin(9600);
  7. }
  8. void loop() {
  9. // put your main code here, to run repeatedly:
  10. Serial.print("LX:");
  11. Serial.print(js.readJoystick(js.LX));
  12. Serial.print(" LY:");
  13. Serial.print(js.readJoystick(js.LY));
  14. Serial.print(" RX:");
  15. Serial.print(js.readJoystick(js.RX));
  16. Serial.print(" RY:");
  17. Serial.print(js.readJoystick(js.RY));
  18. Serial.print(" LB:");
  19. Serial.print(js.readJoystick(js.LBtn));
  20. Serial.print(" RB:");
  21. Serial.println(js.readJoystick(js.RBtn));
  22. }