Hi, <br style="clear: both; font-family: Arial; font-size: medium;">so... I want to make a simple end of filament sensor (something like that: [www.thingiverse.com]), and want to connect it to a max. Z position sensor (because i'm not using it).<br style="clear: both; font-family: Arial; font-size: medium;">I use Rumba mainbord, I know how to make sensor, but... I'm pretty lame at programming.I don't know how to create the code in Repetier Firmware. <br style="clear: both; font-family: Arial; font-size: medium;">I found a code that works in Marlin, and it's made im the way that when the swith is off it calls the M600 to change the filament command.<br style="clear: both; font-family: Arial; font-size: medium;">here is the code which I found that works in Marlin and I my question is how to do it in Repetier Firmware?<br style="clear: both; font-family: Arial; font-size: medium;"><blockquote class="bbcode" style="font-size: 13.6px; margin: 0px 0px 0px 10px; font-family: Arial; font-style: normal;">
<small>Quote</small><br style="clear: both;">in pins.h under the board your using add<br style="clear: both;"><br style="clear: both;">#define PAUSE_PIN 42 <br style="clear: both;"><br style="clear: both;">i used pin 42 just for testing but you can use any you have free.<br style="clear: both;"><br style="clear: both;"><br style="clear: both;">in Marlin.h find void kill(); and add after it<br style="clear: both;"><br style="clear: both;">void pause();<br style="clear: both;"><br style="clear: both;">in Marlin_main.cpp find void setup() and after setup_killpin(); add<br style="clear: both;"><br style="clear: both;">setup_pausepin();<br style="clear: both;"><br style="clear: both;">then find void manage_inactivity() then find <br style="clear: both;"><br style="clear: both;">#if defined(KILL_PIN) && KILL_PIN > -1<br style="clear: both;">if( 0 == READ(KILL_PIN) )<br style="clear: both;">kill();<br style="clear: both;">#endif<br style="clear: both;"><br style="clear: both;">and after it add <br style="clear: both;"><br style="clear: both;">#if defined(PAUSE_PIN) && PAUSE_PIN > -1<br style="clear: both;">if( 0 == READ(PAUSE_PIN) )<br style="clear: both;">pause();<br style="clear: both;">#endif<br style="clear: both;"><br style="clear: both;">finally at the end of the file add the following<br style="clear: both;"><br style="clear: both;">void setup_pausepin()<br style="clear: both;">{<br style="clear: both;">#if defined(PAUSE_PIN) && PAUSE_PIN > -1<br style="clear: both;">pinMode(PAUSE_PIN,INPUT);<br style="clear: both;">WRITE(PAUSE_PIN,HIGH);<br style="clear: both;">#endif<br style="clear: both;">}<br style="clear: both;"><br style="clear: both;">void pause()<br style="clear: both;">{<br style="clear: both;">enquecommand("M600");<br style="clear: both;">enquecommand("G4 P0");<br style="clear: both;">enquecommand("G4 P0");<br style="clear: both;">enquecommand("G4 P0");<br style="clear: both;">}<br style="clear: both;"><br style="clear: both;"><br style="clear: both;">This works but you could change the M600 to what ever you want. The G4 P0 does nothing but is there just to fill the buffer otherwise you get the M600 added 4 times in the buffer.<br style="clear: both;"><br style="clear: both;">Im sure there is a better way but give it a go
<br style="clear: both; font-family: Arial; font-size: medium;"><br style="clear: both; font-family: Arial; font-size: medium;">