From dbee0e9c5424770b9abf8815c0cb8b49de7db77f Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 8 Sep 2019 00:55:34 -0500 Subject: [PATCH] Analog joystick jogging control (#14648) --- Marlin/Configuration_adv.h | 20 ++- Marlin/src/HAL/HAL_STM32F1/HAL.cpp | 31 +++- Marlin/src/Marlin.cpp | 8 + Marlin/src/core/serial.h | 2 + Marlin/src/feature/I2CPositionEncoder.cpp | 2 +- Marlin/src/feature/I2CPositionEncoder.h | 2 +- Marlin/src/feature/bedlevel/ubl/ubl.cpp | 2 +- Marlin/src/feature/joystick.cpp | 151 ++++++++++++++++++ Marlin/src/feature/joystick.h | 53 ++++++ Marlin/src/gcode/parser.h | 8 +- Marlin/src/inc/Conditionals_adv.h | 5 + Marlin/src/inc/Conditionals_post.h | 7 + Marlin/src/module/endstops.cpp | 9 ++ Marlin/src/module/temperature.cpp | 51 ++++++ Marlin/src/module/temperature.h | 39 +++-- buildroot/share/tests/megaatmega2560-tests | 2 +- config/default/Configuration_adv.h | 20 ++- .../3DFabXYZ/Migbot/Configuration_adv.h | 20 ++- .../ADIMLab/Gantry v1/Configuration_adv.h | 20 ++- .../ADIMLab/Gantry v2/Configuration_adv.h | 20 ++- .../AlephObjects/TAZ4/Configuration_adv.h | 20 ++- .../Alfawise/U20-bltouch/Configuration_adv.h | 20 ++- .../examples/Alfawise/U20/Configuration_adv.h | 20 ++- .../AliExpress/UM2pExt/Configuration_adv.h | 20 ++- config/examples/Anet/A2/Configuration_adv.h | 20 ++- .../examples/Anet/A2plus/Configuration_adv.h | 20 ++- config/examples/Anet/A6/Configuration_adv.h | 20 ++- config/examples/Anet/A8/Configuration_adv.h | 20 ++- .../examples/Anet/A8plus/Configuration_adv.h | 20 ++- config/examples/Anet/E16/Configuration_adv.h | 20 ++- .../examples/AnyCubic/i3/Configuration_adv.h | 20 ++- config/examples/ArmEd/Configuration_adv.h | 20 ++- .../BIBO/TouchX/cyclops/Configuration_adv.h | 20 ++- .../BIBO/TouchX/default/Configuration_adv.h | 20 ++- .../examples/BQ/Hephestos/Configuration_adv.h | 20 ++- .../BQ/Hephestos_2/Configuration_adv.h | 20 ++- config/examples/BQ/WITBOX/Configuration_adv.h | 20 ++- config/examples/Cartesio/Configuration_adv.h | 20 ++- .../Creality/CR-10/Configuration_adv.h | 20 ++- .../Creality/CR-10S/Configuration_adv.h | 20 ++- .../Creality/CR-10_5S/Configuration_adv.h | 20 ++- .../Creality/CR-10mini/Configuration_adv.h | 20 ++- .../Creality/CR-20 Pro/Configuration_adv.h | 20 ++- .../Creality/CR-20/Configuration_adv.h | 20 ++- .../Creality/CR-8/Configuration_adv.h | 20 ++- .../Creality/Ender-2/Configuration_adv.h | 20 ++- .../Creality/Ender-3/Configuration_adv.h | 20 ++- .../Creality/Ender-4/Configuration_adv.h | 20 ++- .../Creality/Ender-5/Configuration_adv.h | 20 ++- .../Dagoma/Disco Ultimate/Configuration_adv.h | 20 ++- .../Sidewinder X1/Configuration_adv.h | 20 ++- .../examples/Einstart-S/Configuration_adv.h | 20 ++- .../FYSETC/AIO_II/Configuration_adv.h | 20 ++- .../Cheetah 1.2/BLTouch/Configuration_adv.h | 20 ++- .../Cheetah 1.2/base/Configuration_adv.h | 20 ++- .../Cheetah/BLTouch/Configuration_adv.h | 20 ++- .../FYSETC/Cheetah/base/Configuration_adv.h | 20 ++- .../examples/FYSETC/F6_13/Configuration_adv.h | 20 ++- config/examples/Felix/Configuration_adv.h | 20 ++- .../FlashForge/CreatorPro/Configuration_adv.h | 20 ++- .../FolgerTech/i3-2020/Configuration_adv.h | 20 ++- .../Formbot/Raptor/Configuration_adv.h | 20 ++- .../Formbot/T_Rex_2+/Configuration_adv.h | 20 ++- .../Formbot/T_Rex_3/Configuration_adv.h | 20 ++- .../examples/Geeetech/A10/Configuration_adv.h | 20 ++- .../Geeetech/A10M/Configuration_adv.h | 20 ++- .../Geeetech/A20M/Configuration_adv.h | 20 ++- .../Geeetech/MeCreator2/Configuration_adv.h | 20 ++- .../Prusa i3 Pro C/Configuration_adv.h | 20 ++- .../Prusa i3 Pro W/Configuration_adv.h | 20 ++- config/examples/HMS434/Configuration_adv.h | 20 ++- .../Infitary/i3-M508/Configuration_adv.h | 20 ++- .../examples/JGAurora/A1/Configuration_adv.h | 20 ++- .../examples/JGAurora/A5/Configuration_adv.h | 20 ++- .../examples/JGAurora/A5S/Configuration_adv.h | 20 ++- .../examples/MakerParts/Configuration_adv.h | 20 ++- .../examples/Malyan/M150/Configuration_adv.h | 20 ++- .../examples/Malyan/M200/Configuration_adv.h | 20 ++- .../Micromake/C1/enhanced/Configuration_adv.h | 20 ++- config/examples/Mks/Robin/Configuration_adv.h | 20 ++- config/examples/Mks/Sbase/Configuration_adv.h | 20 ++- .../RapideLite/RL200/Configuration_adv.h | 20 ++- config/examples/RigidBot/Configuration_adv.h | 20 ++- config/examples/SCARA/Configuration_adv.h | 20 ++- .../Black_STM32F407VET6/Configuration_adv.h | 20 ++- .../examples/Sanguinololu/Configuration_adv.h | 20 ++- .../Tevo/Michelangelo/Configuration_adv.h | 20 ++- .../Tevo/Tarantula Pro/Configuration_adv.h | 20 ++- .../Tornado/V1 (MKS Base)/Configuration_adv.h | 20 ++- .../V2 (MKS GEN-L)/Configuration_adv.h | 20 ++- config/examples/TheBorg/Configuration_adv.h | 20 ++- config/examples/TinyBoy2/Configuration_adv.h | 20 ++- .../examples/Tronxy/X3A/Configuration_adv.h | 20 ++- .../Tronxy/X5S-2E/Configuration_adv.h | 20 ++- .../UltiMachine/Archim1/Configuration_adv.h | 20 ++- .../UltiMachine/Archim2/Configuration_adv.h | 20 ++- .../examples/VORONDesign/Configuration_adv.h | 20 ++- .../Velleman/K8200/Configuration_adv.h | 20 ++- .../Velleman/K8400/Configuration_adv.h | 20 ++- .../WASP/PowerWASP/Configuration_adv.h | 20 ++- .../Wanhao/Duplicator 6/Configuration_adv.h | 20 ++- .../Duplicator i3 Mini/Configuration_adv.h | 20 ++- .../delta/Anycubic/Kossel/Configuration_adv.h | 20 ++- .../Dreammaker/Overlord/Configuration_adv.h | 20 ++- .../Overlord_Pro/Configuration_adv.h | 20 ++- .../FLSUN/auto_calibrate/Configuration_adv.h | 20 ++- .../delta/FLSUN/kossel/Configuration_adv.h | 20 ++- .../FLSUN/kossel_mini/Configuration_adv.h | 20 ++- .../Geeetech/Rostock 301/Configuration_adv.h | 20 ++- .../delta/MKS/SBASE/Configuration_adv.h | 20 ++- .../Tevo Little Monster/Configuration_adv.h | 20 ++- .../delta/generic/Configuration_adv.h | 20 ++- .../delta/kossel_mini/Configuration_adv.h | 20 ++- .../delta/kossel_xl/Configuration_adv.h | 20 ++- .../gCreate/gMax1.5+/Configuration_adv.h | 20 ++- config/examples/makibox/Configuration_adv.h | 20 ++- .../tvrrug/Round2/Configuration_adv.h | 20 ++- config/examples/wt150/Configuration_adv.h | 20 ++- 118 files changed, 1986 insertions(+), 446 deletions(-) create mode 100644 Marlin/src/feature/joystick.cpp create mode 100644 Marlin/src/feature/joystick.h diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index dce1faa5bb..fd61fc7c4d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp index 1af050e203..3dbcfa76aa 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp @@ -121,6 +121,15 @@ const uint8_t adc_pins[] = { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH_PIN, #endif + #if HAS_JOY_ADC_X + JOY_X_PIN, + #endif + #if HAS_JOY_ADC_Y + JOY_Y_PIN, + #endif + #if HAS_JOY_ADC_Z + JOY_Z_PIN, + #endif }; enum TEMP_PINS : char { @@ -151,15 +160,20 @@ enum TEMP_PINS : char { #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH, #endif + #if HAS_JOY_ADC_X + JOY_X, + #endif + #if HAS_JOY_ADC_Y + JOY_Y, + #endif + #if HAS_JOY_ADC_Z + JOY_Z, + #endif ADC_PIN_COUNT }; uint16_t HAL_adc_results[ADC_PIN_COUNT]; -// ------------------------ -// Function prototypes -// ------------------------ - // ------------------------ // Private functions // ------------------------ @@ -305,6 +319,15 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if HAS_TEMP_ADC_5 case TEMP_5_PIN: pin_index = TEMP_5; break; #endif + #if HAS_JOY_ADC_X + case JOY_X_PIN: pin_index = JOY_X; break; + #endif + #if HAS_JOY_ADC_Y + case JOY_Y_PIN: pin_index = JOY_Y; break; + #endif + #if HAS_JOY_ADC_Z + case JOY_Z_PIN: pin_index = JOY_Z; break; + #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) case FILWIDTH_PIN: pin_index = FILWIDTH; break; #endif diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 2311301fdc..e288e4837c 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -89,6 +89,10 @@ #include "feature/bltouch.h" #endif +#if ENABLED(POLL_JOG) + #include "feature/joystick.h" +#endif + #if HAS_SERVOS #include "module/servo.h" #endif @@ -739,6 +743,10 @@ void idle( #if ENABLED(PRUSA_MMU2) mmu2.mmu_loop(); #endif + + #if ENABLED(POLL_JOG) + joystick.inject_jog_moves(); + #endif } /** diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 463b9b6f53..a690e0fc39 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -156,6 +156,8 @@ extern uint8_t marlin_debug_flags; #define SERIAL_ECHO_SP(C) serial_spaces(C) +#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST) serial_ternary(TF, PSTR(PRE), PSTR(ON), PSTR(OFF), PSTR(POST)) + // // Functions for serial printing from PROGMEM. (Saves loads of SRAM.) // diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index 7d225b8e08..6f3952fd97 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -233,7 +233,7 @@ bool I2CPositionEncoder::passes_test(const bool report) { switch (H) { case I2CPE_MAG_SIG_GOOD: case I2CPE_MAG_SIG_MID: - serial_ternary(H == I2CPE_MAG_SIG_GOOD, PSTR("passes test; field strength "), PSTR("good"), PSTR("fair"), PSTR(".\n")); + SERIAL_ECHO_TERNARY(H == I2CPE_MAG_SIG_GOOD, "passes test; field strength ", "good", "fair", ".\n"); break; default: SERIAL_ECHOLNPGM("not detected!"); diff --git a/Marlin/src/feature/I2CPositionEncoder.h b/Marlin/src/feature/I2CPositionEncoder.h index 84e4a29519..072aa5e57e 100644 --- a/Marlin/src/feature/I2CPositionEncoder.h +++ b/Marlin/src/feature/I2CPositionEncoder.h @@ -276,7 +276,7 @@ class I2CPositionEncodersMgr { CHECK_IDX(); encoders[idx].set_ec_enabled(enabled); SERIAL_ECHOPAIR("Error correction on ", axis_codes[axis]); - serial_ternary(encoders[idx].get_ec_enabled(), PSTR(" axis is "), PSTR("en"), PSTR("dis"), PSTR("abled.\n")); + SERIAL_ECHO_TERNARY(encoders[idx].get_ec_enabled(), " axis is ", "en", "dis", "abled.\n"); } static void set_ec_threshold(const int8_t idx, const float newThreshold, const AxisEnum axis) { diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index ee8fb48c9d..5716f29558 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -58,7 +58,7 @@ void unified_bed_leveling::report_state() { echo_name(); - serial_ternary(planner.leveling_active, PSTR(" System v" UBL_VERSION " "), PSTR(""), PSTR("in"), PSTR("active\n")); + SERIAL_ECHO_TERNARY(planner.leveling_active, " System v" UBL_VERSION " ", "", "in", "active\n"); serial_delay(50); } diff --git a/Marlin/src/feature/joystick.cpp b/Marlin/src/feature/joystick.cpp new file mode 100644 index 0000000000..efadeeff30 --- /dev/null +++ b/Marlin/src/feature/joystick.cpp @@ -0,0 +1,151 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * joystick.cpp - joystick input / jogging + */ + +#include "../inc/MarlinConfigPre.h" + +#if ENABLED(JOYSTICK) + +#include "joystick.h" + +#include "../inc/MarlinConfig.h" // for pins +#include "../module/planner.h" +#include "../module/temperature.h" + +Joystick joystick; + +#if HAS_JOY_ADC_X + temp_info_t Joystick::x; // = { 0 } +#endif +#if HAS_JOY_ADC_Y + temp_info_t Joystick::y; // = { 0 } +#endif +#if HAS_JOY_ADC_Z + temp_info_t Joystick::z; // = { 0 } +#endif + +#if ENABLED(JOYSTICK_DEBUG) + void Joystick::report() { + SERIAL_ECHOPGM("Joystick"); + #if HAS_JOY_ADC_X + SERIAL_ECHOPAIR(" X", x.raw); + #endif + #if HAS_JOY_ADC_Y + SERIAL_ECHOPAIR(" Y", y.raw); + #endif + #if HAS_JOY_ADC_Z + SERIAL_ECHOPAIR(" Z", z.raw); + #endif + #if HAS_JOY_ADC_EN + SERIAL_ECHO_TERNARY(READ(JOY_EN_PIN), " EN=", "HIGH (dis", "LOW (en", "abled)"); + #endif + SERIAL_EOL(); + } +#endif + +void Joystick::calculate(float norm_jog[XYZ]) { + // Do nothing if enable pin (active-low) is not LOW + #if HAS_JOY_ADC_EN + if (READ(JOY_EN_PIN)) return; + #endif + + auto _normalize_joy = [](float &adc, const int16_t raw, const int16_t (&joy_limits)[4]) { + if (WITHIN(raw, joy_limits[0], joy_limits[3])) { + // within limits, check deadzone + if (raw > joy_limits[2]) + adc = (raw - joy_limits[2]) / float(joy_limits[3] - joy_limits[2]); + else if (raw < joy_limits[1]) + adc = (raw - joy_limits[1]) / float(joy_limits[1] - joy_limits[0]); // negative value + } + }; + + #if HAS_JOY_ADC_X + static constexpr int16_t joy_x_limits[4] = JOY_X_LIMITS; + _normalize_joy(norm_jog[X_AXIS], x.raw, joy_x_limits); + #endif + #if HAS_JOY_ADC_Y + static constexpr int16_t joy_y_limits[4] = JOY_Y_LIMITS; + _normalize_joy(norm_jog[Y_AXIS], y.raw, joy_y_limits); + #endif + #if HAS_JOY_ADC_Z + static constexpr int16_t joy_z_limits[4] = JOY_Z_LIMITS; + _normalize_joy(norm_jog[Z_AXIS], z.raw, joy_z_limits); + #endif +} + +#if ENABLED(POLL_JOG) + + void Joystick::inject_jog_moves() { + // Recursion barrier + static bool injecting_now; // = false; + if (injecting_now) return; + + static constexpr int QUEUE_DEPTH = 5; // Insert up to this many movements + static constexpr float target_lag = 0.25f, // Aim for 1/4 second lag + seg_time = target_lag / QUEUE_DEPTH; // 0.05 seconds, short segments inserted every 1/20th of a second + static constexpr millis_t timer_limit_ms = millis_t(seg_time * 500); // 25 ms minimum delay between insertions + + // The planner can merge/collapse small moves, so the movement queue is unreliable to control the lag + static millis_t next_run = 0; + if (PENDING(millis(), next_run)) return; + next_run = millis() + timer_limit_ms; + + // Only inject a command if the planner has fewer than 5 moves and there are no unparsed commands + if (planner.movesplanned() >= QUEUE_DEPTH || queue.has_commands_queued()) + return; + + // Normalized jog values are 0 for no movement and -1 or +1 for as max feedrate (nonlinear relationship) + // Jog are initialized to zero and handling input can update values but doesn't have to + // You could use a two-axis joystick and a one-axis keypad and they might work together + float norm_jog[XYZ] = { 0 }; + + // Use ADC values and defined limits. The active zone is normalized: -1..0 (dead) 0..1 + joystick.calculate(norm_jog); + + // Other non-joystick poll-based jogging could be implemented here + // with "jogging" encapsulated as a more general class. + + // Jogging value maps continuously (quadratic relationship) to feedrate + float move_dist[XYZ] = { 0 }, hypot2 = 0; + LOOP_XYZ(i) if (norm_jog[i]) { + move_dist[i] = seg_time * sq(norm_jog[i]) * planner.settings.max_feedrate_mm_s[i]; + // Very small movements disappear when printed as decimal with 4 digits of precision + NOLESS(move_dist[i], 0.0002f); + if (norm_jog[i] < 0) move_dist[i] *= -1; // preserve sign + hypot2 += sq(move_dist[i]); + } + + if (!UNEAR_ZERO(hypot2)) { + LOOP_XYZ(i) current_position[i] += move_dist[i]; + const float length = sqrt(hypot2); + injecting_now = true; + planner.buffer_line(current_position, length / seg_time, active_extruder, length); + injecting_now = false; + } + } + +#endif // POLL_JOG + +#endif // JOYSTICK diff --git a/Marlin/src/feature/joystick.h b/Marlin/src/feature/joystick.h new file mode 100644 index 0000000000..57dd5deeb5 --- /dev/null +++ b/Marlin/src/feature/joystick.h @@ -0,0 +1,53 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * joystick.h - joystick input / jogging + */ + +#include "../core/macros.h" +#include "../module/temperature.h" + +//#define JOYSTICK_DEBUG + +class Joystick { + friend class Temperature; + private: + #if HAS_JOY_ADC_X + static temp_info_t x; + #endif + #if HAS_JOY_ADC_Y + static temp_info_t y; + #endif + #if HAS_JOY_ADC_Z + static temp_info_t z; + #endif + public: + #if ENABLED(JOYSTICK_DEBUG) + static void report(); + #endif + static void calculate(float norm_jog[XYZ]); + static void inject_jog_moves(); +}; + +extern Joystick joystick; diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 8798ed486a..1917faa741 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -263,13 +263,9 @@ public: static inline void set_input_linear_units(const LinearUnit units) { switch (units) { - case LINEARUNIT_INCH: - linear_unit_factor = 25.4f; - break; - case LINEARUNIT_MM: default: - linear_unit_factor = 1; - break; + case LINEARUNIT_MM: linear_unit_factor = 1.0f; break; + case LINEARUNIT_INCH: linear_unit_factor = 25.4f; break; } volumetric_unit_factor = POW(linear_unit_factor, 3); } diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index a77117d50b..37ec8c09ae 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -105,3 +105,8 @@ // TMC SPI Chaining #define TMC_USE_CHAIN (X_CHAIN_POS||Y_CHAIN_POS||Z_CHAIN_POS||X2_CHAIN_POS||Y2_CHAIN_POS||Z2_CHAIN_POS||Z3_CHAIN_POS||E0_CHAIN_POS||E1_CHAIN_POS||E2_CHAIN_POS||E3_CHAIN_POS||E4_CHAIN_POS||E5_CHAIN_POS) + +// Poll-based jogging for joystick and other devices +#if ENABLED(JOYSTICK) + #define POLL_JOG +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 4aa411e281..4e8f0ea4ff 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1026,6 +1026,13 @@ #define HAS_TEMP_CHAMBER HAS_TEMP_ADC_CHAMBER #define HAS_HEATED_CHAMBER (HAS_TEMP_CHAMBER && PIN_EXISTS(HEATER_CHAMBER)) +#if ENABLED(JOYSTICK) + #define HAS_JOY_ADC_X PIN_EXISTS(JOY_X) + #define HAS_JOY_ADC_Y PIN_EXISTS(JOY_Y) + #define HAS_JOY_ADC_Z PIN_EXISTS(JOY_Z) + #define HAS_JOY_ADC_EN PIN_EXISTS(JOY_EN) +#endif + // Heaters #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) #define HAS_HEATER_1 (PIN_EXISTS(HEATER_1)) diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index b1a4f9e57f..04f1ab6b17 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -44,6 +44,10 @@ #include "../feature/bltouch.h" #endif +#if ENABLED(JOYSTICK) + #include "../feature/joystick.h" +#endif + Endstops endstops; // private: @@ -474,6 +478,11 @@ void _O2 Endstops::M119() { #if ENABLED(BLTOUCH) bltouch._reset_SW_mode(); #endif + + #if ENABLED(JOYSTICK_DEBUG) + joystick.report(); + #endif + } // Endstops::M119 // The following routines are called from an ISR context. It could be the temperature ISR, the diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index fb762ed597..db584f17a4 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -64,6 +64,10 @@ #include "../feature/leds/printer_event_leds.h" #endif +#if ENABLED(JOYSTICK) + #include "../feature/joystick.h" +#endif + #if ENABLED(SINGLENOZZLE) #include "tool_change.h" #endif @@ -1685,6 +1689,18 @@ void Temperature::init() { #if HAS_TEMP_ADC_5 HAL_ANALOG_SELECT(TEMP_5_PIN); #endif + #if HAS_JOY_ADC_X + HAL_ANALOG_SELECT(JOY_X_PIN); + #endif + #if HAS_JOY_ADC_Y + HAL_ANALOG_SELECT(JOY_Y_PIN); + #endif + #if HAS_JOY_ADC_Z + HAL_ANALOG_SELECT(JOY_Z_PIN); + #endif + #if HAS_JOY_ADC_EN + SET_INPUT_PULLUP(JOY_EN_PIN); + #endif #if HAS_HEATED_BED HAL_ANALOG_SELECT(TEMP_BED_PIN); #endif @@ -2195,6 +2211,16 @@ void Temperature::set_current_temp_raw() { temp_chamber.update(); #endif + #if HAS_JOY_ADC_X + joystick.x.update(); + #endif + #if HAS_JOY_ADC_Y + joystick.y.update(); + #endif + #if HAS_JOY_ADC_Z + joystick.z.update(); + #endif + temp_meas_ready = true; } @@ -2225,6 +2251,16 @@ void Temperature::readings_ready() { temp_chamber.reset(); #endif + #if HAS_JOY_ADC_X + joystick.x.reset(); + #endif + #if HAS_JOY_ADC_Y + joystick.y.reset(); + #endif + #if HAS_JOY_ADC_Z + joystick.z.reset(); + #endif + static constexpr int8_t temp_dir[] = { #if ENABLED(HEATER_0_USES_MAX6675) 0 @@ -2721,6 +2757,21 @@ void Temperature::isr() { break; #endif + #if HAS_JOY_ADC_X + case PrepareJoy_X: HAL_START_ADC(JOY_X_PIN); break; + case MeasureJoy_X: ACCUMULATE_ADC(joystick.x); break; + #endif + + #if HAS_JOY_ADC_Y + case PrepareJoy_Y: HAL_START_ADC(JOY_Y_PIN); break; + case MeasureJoy_Y: ACCUMULATE_ADC(joystick.y); break; + #endif + + #if HAS_JOY_ADC_Z + case PrepareJoy_Z: HAL_START_ADC(JOY_Z_PIN); break; + case MeasureJoy_Z: ACCUMULATE_ADC(joystick.z); break; + #endif + #if HAS_ADC_BUTTONS case Prepare_ADC_KEY: HAL_START_ADC(ADC_KEYPAD_PIN); break; case Measure_ADC_KEY: diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index b4db416f14..662d1866d4 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -92,44 +92,43 @@ typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t; enum ADCSensorState : char { StartSampling, #if HAS_TEMP_ADC_0 - PrepareTemp_0, - MeasureTemp_0, + PrepareTemp_0, MeasureTemp_0, #endif #if HAS_HEATED_BED - PrepareTemp_BED, - MeasureTemp_BED, + PrepareTemp_BED, MeasureTemp_BED, #endif #if HAS_TEMP_CHAMBER - PrepareTemp_CHAMBER, - MeasureTemp_CHAMBER, + PrepareTemp_CHAMBER, MeasureTemp_CHAMBER, #endif #if HAS_TEMP_ADC_1 - PrepareTemp_1, - MeasureTemp_1, + PrepareTemp_1, MeasureTemp_1, #endif #if HAS_TEMP_ADC_2 - PrepareTemp_2, - MeasureTemp_2, + PrepareTemp_2, MeasureTemp_2, #endif #if HAS_TEMP_ADC_3 - PrepareTemp_3, - MeasureTemp_3, + PrepareTemp_3, MeasureTemp_3, #endif #if HAS_TEMP_ADC_4 - PrepareTemp_4, - MeasureTemp_4, + PrepareTemp_4, MeasureTemp_4, #endif #if HAS_TEMP_ADC_5 - PrepareTemp_5, - MeasureTemp_5, + PrepareTemp_5, MeasureTemp_5, + #endif + #if HAS_JOY_ADC_X + PrepareJoy_X, MeasureJoy_X, + #endif + #if HAS_JOY_ADC_Y + PrepareJoy_Y, MeasureJoy_Y, + #endif + #if HAS_JOY_ADC_Z + PrepareJoy_Z, MeasureJoy_Z, #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - Prepare_FILWIDTH, - Measure_FILWIDTH, + Prepare_FILWIDTH, Measure_FILWIDTH, #endif #if HAS_ADC_BUTTONS - Prepare_ADC_KEY, - Measure_ADC_KEY, + Prepare_ADC_KEY, Measure_ADC_KEY, #endif SensorsReady, // Temperatures ready. Delay the next round of readings to let ADC pins settle. StartupDelay // Startup, delay initial temp reading a tiny bit so the hardware can settle diff --git a/buildroot/share/tests/megaatmega2560-tests b/buildroot/share/tests/megaatmega2560-tests index 9f65ba9fd6..c949c24bb0 100755 --- a/buildroot/share/tests/megaatmega2560-tests +++ b/buildroot/share/tests/megaatmega2560-tests @@ -79,7 +79,7 @@ restore_configs opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT opt_set NUM_SERVOS 1 -opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET +opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK exec_test $1 $2 "RAMPS with ZONESTAR_LCD, Servo Probe, 3-Point ABL, DEBUG_LEVELING_FEATURE, EEPROM, G38, and more" # diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h index dce1faa5bb..fd61fc7c4d 100644 --- a/config/default/Configuration_adv.h +++ b/config/default/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index 3d9893648b..01dd28c0bf 100644 --- a/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h index 32a4c0d83a..f9a2a2f7ae 100644 --- a/config/examples/ADIMLab/Gantry v1/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v1/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h index e61da380d8..e2642e141f 100644 --- a/config/examples/ADIMLab/Gantry v2/Configuration_adv.h +++ b/config/examples/ADIMLab/Gantry v2/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 65ccc64cbc..fa590fec3b 100644 --- a/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h index 1d2a2e52c7..667c93a19e 100644 --- a/config/examples/Alfawise/U20-bltouch/Configuration_adv.h +++ b/config/examples/Alfawise/U20-bltouch/Configuration_adv.h @@ -2467,10 +2467,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2551,6 +2547,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Alfawise/U20/Configuration_adv.h b/config/examples/Alfawise/U20/Configuration_adv.h index 93c77392c8..dff74f2549 100644 --- a/config/examples/Alfawise/U20/Configuration_adv.h +++ b/config/examples/Alfawise/U20/Configuration_adv.h @@ -2466,10 +2466,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2550,6 +2546,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/AliExpress/UM2pExt/Configuration_adv.h b/config/examples/AliExpress/UM2pExt/Configuration_adv.h index 03de52bffa..f8832bf51b 100644 --- a/config/examples/AliExpress/UM2pExt/Configuration_adv.h +++ b/config/examples/AliExpress/UM2pExt/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A2/Configuration_adv.h b/config/examples/Anet/A2/Configuration_adv.h index 1862fc31b1..3ef8bdf46e 100644 --- a/config/examples/Anet/A2/Configuration_adv.h +++ b/config/examples/Anet/A2/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A2plus/Configuration_adv.h b/config/examples/Anet/A2plus/Configuration_adv.h index 1862fc31b1..3ef8bdf46e 100644 --- a/config/examples/Anet/A2plus/Configuration_adv.h +++ b/config/examples/Anet/A2plus/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A6/Configuration_adv.h b/config/examples/Anet/A6/Configuration_adv.h index aa68b8a623..4c653ecb80 100644 --- a/config/examples/Anet/A6/Configuration_adv.h +++ b/config/examples/Anet/A6/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A8/Configuration_adv.h b/config/examples/Anet/A8/Configuration_adv.h index d900bc9a5d..b76295459b 100644 --- a/config/examples/Anet/A8/Configuration_adv.h +++ b/config/examples/Anet/A8/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/A8plus/Configuration_adv.h b/config/examples/Anet/A8plus/Configuration_adv.h index 53586166a5..6e316f8ef3 100644 --- a/config/examples/Anet/A8plus/Configuration_adv.h +++ b/config/examples/Anet/A8plus/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Anet/E16/Configuration_adv.h b/config/examples/Anet/E16/Configuration_adv.h index 655959ccfd..a03866045b 100644 --- a/config/examples/Anet/E16/Configuration_adv.h +++ b/config/examples/Anet/E16/Configuration_adv.h @@ -2462,10 +2462,6 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/AnyCubic/i3/Configuration_adv.h b/config/examples/AnyCubic/i3/Configuration_adv.h index 366cadad25..71c4de3095 100644 --- a/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/config/examples/AnyCubic/i3/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/ArmEd/Configuration_adv.h b/config/examples/ArmEd/Configuration_adv.h index 56383b5511..52018cea91 100644 --- a/config/examples/ArmEd/Configuration_adv.h +++ b/config/examples/ArmEd/Configuration_adv.h @@ -2466,10 +2466,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2550,6 +2546,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index 1694d39837..c66417e0c1 100644 --- a/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BIBO/TouchX/default/Configuration_adv.h b/config/examples/BIBO/TouchX/default/Configuration_adv.h index 36127da610..5fe76986b4 100644 --- a/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BQ/Hephestos/Configuration_adv.h b/config/examples/BQ/Hephestos/Configuration_adv.h index bb8be36abf..f4d751d6eb 100644 --- a/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/config/examples/BQ/Hephestos/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BQ/Hephestos_2/Configuration_adv.h b/config/examples/BQ/Hephestos_2/Configuration_adv.h index 84deaedbf0..47d61d3e21 100644 --- a/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -2470,10 +2470,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2554,6 +2550,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/BQ/WITBOX/Configuration_adv.h b/config/examples/BQ/WITBOX/Configuration_adv.h index bb8be36abf..f4d751d6eb 100644 --- a/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/config/examples/BQ/WITBOX/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Cartesio/Configuration_adv.h b/config/examples/Cartesio/Configuration_adv.h index 89788cba98..680a271090 100644 --- a/config/examples/Cartesio/Configuration_adv.h +++ b/config/examples/Cartesio/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10/Configuration_adv.h b/config/examples/Creality/CR-10/Configuration_adv.h index c0fed523e5..a24ee43359 100644 --- a/config/examples/Creality/CR-10/Configuration_adv.h +++ b/config/examples/Creality/CR-10/Configuration_adv.h @@ -2465,10 +2465,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2549,6 +2545,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10S/Configuration_adv.h b/config/examples/Creality/CR-10S/Configuration_adv.h index d76d489f98..3039d93b51 100644 --- a/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/config/examples/Creality/CR-10S/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10_5S/Configuration_adv.h b/config/examples/Creality/CR-10_5S/Configuration_adv.h index f1bc2e3121..be2706933c 100644 --- a/config/examples/Creality/CR-10_5S/Configuration_adv.h +++ b/config/examples/Creality/CR-10_5S/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-10mini/Configuration_adv.h b/config/examples/Creality/CR-10mini/Configuration_adv.h index e5e77d0c2b..44b247c566 100644 --- a/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-20 Pro/Configuration_adv.h b/config/examples/Creality/CR-20 Pro/Configuration_adv.h index b5af25eb4e..0eb08b3814 100644 --- a/config/examples/Creality/CR-20 Pro/Configuration_adv.h +++ b/config/examples/Creality/CR-20 Pro/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-20/Configuration_adv.h b/config/examples/Creality/CR-20/Configuration_adv.h index ce66bde5f6..cdd5071d8c 100644 --- a/config/examples/Creality/CR-20/Configuration_adv.h +++ b/config/examples/Creality/CR-20/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/CR-8/Configuration_adv.h b/config/examples/Creality/CR-8/Configuration_adv.h index ef477269a5..5690f1e5c1 100644 --- a/config/examples/Creality/CR-8/Configuration_adv.h +++ b/config/examples/Creality/CR-8/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-2/Configuration_adv.h b/config/examples/Creality/Ender-2/Configuration_adv.h index 197912cc9d..49b29c96f8 100644 --- a/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/config/examples/Creality/Ender-2/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-3/Configuration_adv.h b/config/examples/Creality/Ender-3/Configuration_adv.h index 28c22fa674..0c19e4a498 100644 --- a/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/config/examples/Creality/Ender-3/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-4/Configuration_adv.h b/config/examples/Creality/Ender-4/Configuration_adv.h index 03495f3fd3..18d427c713 100644 --- a/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/config/examples/Creality/Ender-4/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Creality/Ender-5/Configuration_adv.h b/config/examples/Creality/Ender-5/Configuration_adv.h index 646765adf1..bcc725e71c 100644 --- a/config/examples/Creality/Ender-5/Configuration_adv.h +++ b/config/examples/Creality/Ender-5/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h index 3f361ad94c..c4e7ead071 100644 --- a/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h +++ b/config/examples/Dagoma/Disco Ultimate/Configuration_adv.h @@ -2462,10 +2462,6 @@ #define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h index 2eba631068..2ef2d2f486 100755 --- a/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h +++ b/config/examples/EVNOVO (Artillery)/Sidewinder X1/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Einstart-S/Configuration_adv.h b/config/examples/Einstart-S/Configuration_adv.h index 94be91c409..f18712292b 100644 --- a/config/examples/Einstart-S/Configuration_adv.h +++ b/config/examples/Einstart-S/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/AIO_II/Configuration_adv.h b/config/examples/FYSETC/AIO_II/Configuration_adv.h index 86df417719..3eb56b8f39 100644 --- a/config/examples/FYSETC/AIO_II/Configuration_adv.h +++ b/config/examples/FYSETC/AIO_II/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h index cdf808528a..859292abaa 100644 --- a/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/BLTouch/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h index cdf808528a..859292abaa 100644 --- a/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah 1.2/base/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h index cdf808528a..859292abaa 100644 --- a/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah/BLTouch/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h index cdf808528a..859292abaa 100644 --- a/config/examples/FYSETC/Cheetah/base/Configuration_adv.h +++ b/config/examples/FYSETC/Cheetah/base/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FYSETC/F6_13/Configuration_adv.h b/config/examples/FYSETC/F6_13/Configuration_adv.h index 7f02f13ecd..34daecb505 100644 --- a/config/examples/FYSETC/F6_13/Configuration_adv.h +++ b/config/examples/FYSETC/F6_13/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Felix/Configuration_adv.h b/config/examples/Felix/Configuration_adv.h index 80cfc8a7b0..8f634be47d 100644 --- a/config/examples/Felix/Configuration_adv.h +++ b/config/examples/Felix/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/config/examples/FlashForge/CreatorPro/Configuration_adv.h index 542ee5241e..4298a7b924 100644 --- a/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -2461,10 +2461,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2545,6 +2541,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 475df0a70d..d76a1e9fbe 100644 --- a/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Formbot/Raptor/Configuration_adv.h b/config/examples/Formbot/Raptor/Configuration_adv.h index 51c33e674f..1839493d27 100644 --- a/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/config/examples/Formbot/Raptor/Configuration_adv.h @@ -2466,10 +2466,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2550,6 +2546,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index 1afa203754..0d9836ec29 100644 --- a/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -2466,10 +2466,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2550,6 +2546,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/config/examples/Formbot/T_Rex_3/Configuration_adv.h index 1f782f7ac7..1202da2976 100644 --- a/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -2461,10 +2461,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2545,6 +2541,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/A10/Configuration_adv.h b/config/examples/Geeetech/A10/Configuration_adv.h index 4827c06d0f..0d84fb846a 100644 --- a/config/examples/Geeetech/A10/Configuration_adv.h +++ b/config/examples/Geeetech/A10/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/A10M/Configuration_adv.h b/config/examples/Geeetech/A10M/Configuration_adv.h index a200f8bd0c..3aecc80ded 100644 --- a/config/examples/Geeetech/A10M/Configuration_adv.h +++ b/config/examples/Geeetech/A10M/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/A20M/Configuration_adv.h b/config/examples/Geeetech/A20M/Configuration_adv.h index bde75b3bcd..adff4d9883 100644 --- a/config/examples/Geeetech/A20M/Configuration_adv.h +++ b/config/examples/Geeetech/A20M/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/config/examples/Geeetech/MeCreator2/Configuration_adv.h index cd2889eadc..02c2d434e9 100644 --- a/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -2461,10 +2461,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2545,6 +2541,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index 4827c06d0f..0d84fb846a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index 4827c06d0f..0d84fb846a 100644 --- a/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/HMS434/Configuration_adv.h b/config/examples/HMS434/Configuration_adv.h index 47d41e50b8..2afa4fd718 100644 --- a/config/examples/HMS434/Configuration_adv.h +++ b/config/examples/HMS434/Configuration_adv.h @@ -2384,10 +2384,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2468,6 +2464,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Infitary/i3-M508/Configuration_adv.h b/config/examples/Infitary/i3-M508/Configuration_adv.h index c601a74674..73a11bd812 100644 --- a/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/JGAurora/A1/Configuration_adv.h b/config/examples/JGAurora/A1/Configuration_adv.h index ca1b28b3cc..05a21dc721 100644 --- a/config/examples/JGAurora/A1/Configuration_adv.h +++ b/config/examples/JGAurora/A1/Configuration_adv.h @@ -2467,10 +2467,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2551,6 +2547,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/JGAurora/A5/Configuration_adv.h b/config/examples/JGAurora/A5/Configuration_adv.h index 59b935b9ee..835d812f58 100644 --- a/config/examples/JGAurora/A5/Configuration_adv.h +++ b/config/examples/JGAurora/A5/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/JGAurora/A5S/Configuration_adv.h b/config/examples/JGAurora/A5S/Configuration_adv.h index ca1b28b3cc..05a21dc721 100644 --- a/config/examples/JGAurora/A5S/Configuration_adv.h +++ b/config/examples/JGAurora/A5S/Configuration_adv.h @@ -2467,10 +2467,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2551,6 +2547,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/MakerParts/Configuration_adv.h b/config/examples/MakerParts/Configuration_adv.h index ed415f8096..63394b39d8 100644 --- a/config/examples/MakerParts/Configuration_adv.h +++ b/config/examples/MakerParts/Configuration_adv.h @@ -2455,10 +2455,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2539,6 +2535,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Malyan/M150/Configuration_adv.h b/config/examples/Malyan/M150/Configuration_adv.h index 81960731c1..0fc00b7cad 100644 --- a/config/examples/Malyan/M150/Configuration_adv.h +++ b/config/examples/Malyan/M150/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Malyan/M200/Configuration_adv.h b/config/examples/Malyan/M200/Configuration_adv.h index 6f139382af..f87f6e8001 100644 --- a/config/examples/Malyan/M200/Configuration_adv.h +++ b/config/examples/Malyan/M200/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 115b2a5c0c..ea3b961840 100644 --- a/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Mks/Robin/Configuration_adv.h b/config/examples/Mks/Robin/Configuration_adv.h index b5bc370609..bf25955053 100644 --- a/config/examples/Mks/Robin/Configuration_adv.h +++ b/config/examples/Mks/Robin/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index 811f66ff2e..1a607ac4bf 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -2463,10 +2463,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2547,6 +2543,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/RapideLite/RL200/Configuration_adv.h b/config/examples/RapideLite/RL200/Configuration_adv.h index 7190339f01..8106137716 100644 --- a/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/config/examples/RapideLite/RL200/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/RigidBot/Configuration_adv.h b/config/examples/RigidBot/Configuration_adv.h index 2444d60051..51c88384ad 100644 --- a/config/examples/RigidBot/Configuration_adv.h +++ b/config/examples/RigidBot/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/SCARA/Configuration_adv.h b/config/examples/SCARA/Configuration_adv.h index ad90daf38a..b22f88e748 100644 --- a/config/examples/SCARA/Configuration_adv.h +++ b/config/examples/SCARA/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h index 40ced02dea..a96aef9704 100644 --- a/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h +++ b/config/examples/STM32/Black_STM32F407VET6/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Sanguinololu/Configuration_adv.h b/config/examples/Sanguinololu/Configuration_adv.h index f952cb810d..29a2abd7ae 100644 --- a/config/examples/Sanguinololu/Configuration_adv.h +++ b/config/examples/Sanguinololu/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Michelangelo/Configuration_adv.h b/config/examples/Tevo/Michelangelo/Configuration_adv.h index 53a58506c2..4cad2a925c 100644 --- a/config/examples/Tevo/Michelangelo/Configuration_adv.h +++ b/config/examples/Tevo/Michelangelo/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h index e24db86c05..8d37dee772 100755 --- a/config/examples/Tevo/Tarantula Pro/Configuration_adv.h +++ b/config/examples/Tevo/Tarantula Pro/Configuration_adv.h @@ -2458,10 +2458,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2542,6 +2538,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h index d9fd8aaf92..f97f72eb16 100755 --- a/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V1 (MKS Base)/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h index d9fd8aaf92..f97f72eb16 100755 --- a/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h +++ b/config/examples/Tevo/Tornado/V2 (MKS GEN-L)/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/TheBorg/Configuration_adv.h b/config/examples/TheBorg/Configuration_adv.h index acd46d1b8d..548ba04156 100644 --- a/config/examples/TheBorg/Configuration_adv.h +++ b/config/examples/TheBorg/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/TinyBoy2/Configuration_adv.h b/config/examples/TinyBoy2/Configuration_adv.h index 9e00b3644e..ed17f88c2b 100644 --- a/config/examples/TinyBoy2/Configuration_adv.h +++ b/config/examples/TinyBoy2/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tronxy/X3A/Configuration_adv.h b/config/examples/Tronxy/X3A/Configuration_adv.h index bd0e41fead..4de9a8195e 100644 --- a/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/config/examples/Tronxy/X3A/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Tronxy/X5S-2E/Configuration_adv.h b/config/examples/Tronxy/X5S-2E/Configuration_adv.h index 4540c2a34f..890f23f588 100644 --- a/config/examples/Tronxy/X5S-2E/Configuration_adv.h +++ b/config/examples/Tronxy/X5S-2E/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/UltiMachine/Archim1/Configuration_adv.h b/config/examples/UltiMachine/Archim1/Configuration_adv.h index d27997be0c..eeac2772de 100644 --- a/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/UltiMachine/Archim2/Configuration_adv.h b/config/examples/UltiMachine/Archim2/Configuration_adv.h index c753b3f514..68de71aafa 100644 --- a/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/VORONDesign/Configuration_adv.h b/config/examples/VORONDesign/Configuration_adv.h index 3b474cf6bf..de4e0ae81b 100644 --- a/config/examples/VORONDesign/Configuration_adv.h +++ b/config/examples/VORONDesign/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Velleman/K8200/Configuration_adv.h b/config/examples/Velleman/K8200/Configuration_adv.h index 142da6fc9d..b06c634575 100644 --- a/config/examples/Velleman/K8200/Configuration_adv.h +++ b/config/examples/Velleman/K8200/Configuration_adv.h @@ -2475,10 +2475,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2559,6 +2555,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Velleman/K8400/Configuration_adv.h b/config/examples/Velleman/K8400/Configuration_adv.h index 9a7d7194a3..9cc8b8ad75 100644 --- a/config/examples/Velleman/K8400/Configuration_adv.h +++ b/config/examples/Velleman/K8400/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/WASP/PowerWASP/Configuration_adv.h b/config/examples/WASP/PowerWASP/Configuration_adv.h index 2b727784cc..e334152678 100644 --- a/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 05caad71b6..d8c20c700e 100644 --- a/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h index f2a57cd908..3b74b2e52f 100644 --- a/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h +++ b/config/examples/Wanhao/Duplicator i3 Mini/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index 61f4bd5288..ad6e65b7fc 100644 --- a/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h index f1c2c80a28..4fd379f255 100644 --- a/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord/Configuration_adv.h @@ -2452,10 +2452,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2536,6 +2532,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h index f1c2c80a28..4fd379f255 100644 --- a/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h +++ b/config/examples/delta/Dreammaker/Overlord_Pro/Configuration_adv.h @@ -2452,10 +2452,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2536,6 +2532,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 8644088679..17512317dc 100644 --- a/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 8644088679..17512317dc 100644 --- a/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index 9b1308dd63..3c644e1b70 100644 --- a/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index f5efe42378..e9ceba9bf7 100644 --- a/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/MKS/SBASE/Configuration_adv.h b/config/examples/delta/MKS/SBASE/Configuration_adv.h index bfa0d91333..4ca71cc921 100644 --- a/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/config/examples/delta/Tevo Little Monster/Configuration_adv.h index d474193959..ab8ce275b1 100644 --- a/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/generic/Configuration_adv.h b/config/examples/delta/generic/Configuration_adv.h index 9b1308dd63..3c644e1b70 100644 --- a/config/examples/delta/generic/Configuration_adv.h +++ b/config/examples/delta/generic/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/kossel_mini/Configuration_adv.h b/config/examples/delta/kossel_mini/Configuration_adv.h index 9b1308dd63..3c644e1b70 100644 --- a/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/config/examples/delta/kossel_mini/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/delta/kossel_xl/Configuration_adv.h b/config/examples/delta/kossel_xl/Configuration_adv.h index f5c45622e8..ff4856232c 100644 --- a/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/config/examples/delta/kossel_xl/Configuration_adv.h @@ -2464,10 +2464,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2548,6 +2544,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 82ddab9557..2dbbd149cf 100644 --- a/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/makibox/Configuration_adv.h b/config/examples/makibox/Configuration_adv.h index 8bbc970124..ccf17b5f9d 100644 --- a/config/examples/makibox/Configuration_adv.h +++ b/config/examples/makibox/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/tvrrug/Round2/Configuration_adv.h b/config/examples/tvrrug/Round2/Configuration_adv.h index 68bbfb6ad9..31ca42a10f 100644 --- a/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/config/examples/tvrrug/Round2/Configuration_adv.h @@ -2462,10 +2462,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2546,6 +2542,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix * diff --git a/config/examples/wt150/Configuration_adv.h b/config/examples/wt150/Configuration_adv.h index 3cd660dd87..19e912d9c4 100644 --- a/config/examples/wt150/Configuration_adv.h +++ b/config/examples/wt150/Configuration_adv.h @@ -2463,10 +2463,6 @@ //#define HOST_PROMPT_SUPPORT #endif -//=========================================================================== -//====================== I2C Position Encoder Settings ====================== -//=========================================================================== - /** * I2C position encoders for closed loop control. * Developed by Chris Barr at Aus3D. @@ -2547,6 +2543,22 @@ #endif // I2C_POSITION_ENCODERS +/** + * Analog Joystick(s) + */ +//#define JOYSTICK +#if ENABLED(JOYSTICK) + #define JOY_X_PIN 5 // RAMPS: Suggested pin A5 on AUX2 + #define JOY_Y_PIN 10 // RAMPS: Suggested pin A10 on AUX2 + #define JOY_Z_PIN 12 // RAMPS: Suggested pin A12 on AUX2 + #define JOY_EN_PIN 44 // RAMPS: Suggested pin D44 on AUX2 + + // Use M119 to find reasonable values after connecting your hardware: + #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } // min, deadzone start, deadzone end, max + #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } + #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } +#endif + /** * MAX7219 Debug Matrix *