Welcome! Log In Create A New Profile

Advanced

Help with Controlling an LED While Idle and Printing

Posted by additive_artifice 
Help with Controlling an LED While Idle and Printing
December 09, 2019 01:21AM
Greetings,

I am new to the RepRap forums, so apologies if I have posted in the wrong section. I am building a Nutella printer that uses only x and y axes and a massive syringe as the extruder, controlled via RAMPS and 2560 running latest Marlin. I have gotten nearly everything working great, and have printed with it successfully, but now I would like to add a "watchdog" LED that blinks at a certain frequency while the printer is idle and at another frequency while printing. I have hooked up a single light emitting diode to pin 40 on Aux2 on the ramps, and have been able to control it using M42 in Gcode, but I would like to be able to have it blinking while no Gcode is running so that makes me think my solution will be firmware related. I've looked through the Marlin config file, and at the LED section, but I'm not totally sure how I could adapt the current code for custom control of my LED. I am fairly new to the world of Arduino and RepRap, but I can program Arduino's since I know basic C++, so could I simply write a small program somewhere in the firmware that controls the LED via DigitalWrite etc? Or does it not work like that? Thanks for any help you guys can offer.
Re: Help with Controlling an LED While Idle and Printing
December 09, 2019 02:12AM
Actually, as I continue to think about this problem further, I am considering simply using an additional Arduino Uno to control the LED. When the printer is idle the Uno will blink the diode, and when the printer starts running Gcode, I can send an M42 command to trigger the Uno to change the blinking frequency. Plus I could add additional buttons and whatnot very easily. If anyone has a better way to package the solution onto the single Mega board that would be awesome, as I am curious how it could be done in firmware, but in the mean time I will pursue the Uno solution.
Re: Help with Controlling an LED While Idle and Printing
December 10, 2019 04:08AM
The latter would be easier and wouldn't need firmware modifications

but please don't use a mega... use a attiny85 or something similarly small.

A mega would be like dropping a mountain on a nail in lei of a hammer.
Sorry, only registered users may post in this forum.

Click here to login