Welcome to Marlin-CNC-Pendant Discussions! #7
Replies: 2 comments
-
Hi Michael, i am working on Marlin project with a mpg pendant directly connected to a ARDUINO MEGA2560. The connection is on PK0 /PCINT16 and PK1/PCINT17. I am implementing a ISR similar to the one of endstops. Do you have an idea how to inject the jogging moves without having to mimic joystick movements with an ADC ? Can i just use the digital values you feed to MCP4151 in the " Joystick::inject_jog_moves() " as the raw values ? |
Beta Was this translation helpful? Give feedback.
-
Hi Phillip. It's been a while since I put this together and I've just scanned quickly over the code, but essentially each of the MCP4151's are mimicking a potentiometer, so the 'wiperPosition' variable within the sendJogSignal contains the analog representation of the potentiometer position. I went this route to avoid hacking the marlin code, so am unfamiliar with how / where to inject the values. I might suggest taking a look at the marlin code that deals with the joystick inputs as the destination and functionality will be the same. If you can determine what functions related to this you may be able to call them from whatever new functions you are writing. The interrupts that I have written will work with any two phase rotary encoder, so you should be able to adopt them more easily than modifying an end stop interrupt. Or perhaps simply combine the two. Hope this helps. Also... One thing to consider is that the Mega only has six external interrupts, I'm not sure how many the standard code uses but would be worth checking (3 axis + estop + 1 or 2 hot ends etc) /DM |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions