Welcome! Log In Create A New Profile

Advanced

Best way to add additional analog input to Marlin?

Posted by Claghorn 
Best way to add additional analog input to Marlin?
January 04, 2014 07:51PM
I'm working on a way to get Marlin to use the nozzle on the print head as a bed level sensor by adding a force sensitive resistor to the carriage that gets "squeezed" when the nozzle touches the bed.

I could certainly just hack the state machine in the interrupt routine in temperature.cpp, but I'm trying to figure out a good way to write the code that will integrate well with the existing source and be more likely to be accepted as a patch.

My problem is I can think of a half dozen ways to smack the code around, none of which seem very clean. Any opinions on the best way to integrate polling of additional non-thermistor analog inputs in the interrupt code?

If this is like every other forum in the universe, I can't post links yet, but if you want to see details look at thingiverse thing 216742 and follow the links there.
Re: Best way to add additional analog input to Marlin?
January 13, 2014 05:16PM
if you are using marlin firmware:

this likely will only happen when homing correct? look for the homing code sections. I think they are in marlin_main.cpp, around line 600 or so.

you do not need to worry about interrupts during homing operation of adc. you could temporarily disable them, and do a normal analog read sequence, then when code is refined and process is tested you could look at this: temperature.h

it is pretty much spelled out in the code there.



The fact that you did not know this concerns me, it tells me you have not read the code or the comments in the code. I've helped people out with such basics before just to be asked to do there work for them, so do some digging, and ask specifics!!

Edited 1 time(s). Last edit at 01/13/2014 05:17PM by jamesdanielv.
Sorry, only registered users may post in this forum.

Click here to login