I am quite the software noob, but I am working on adding software control of LEDs to the printer that I am working on (using Marlin). I did, however, run into a strange problem (see video).
I have made some changes to the language.h and ultralcd.h files for the LCD interface. The LEDs are controlled with M-code (M150), and a modified version of the included BlinkM library. I am driving the LEDs using the analogWrite() function and with the onboard FETs of the X3.
Has anyone experienced this problem/know how I can fix it?
If you need the code, just ask
Thanks in advance,
Does it only corrupt on the switch to green?
I think electrical interference corrupts the displays. I get similar corruption after several hours of operation, just been too lazy to fix it. Re-routing wires away from the LCD cables, shortening the LCD cable, or getting shielded cables might help.
Interesting Idea @Jeff_DeMaagd
After a little more testing, I think it has to do with using analogWrite() to drive the LEDs–I think this messes with some of the timer registers and causes the software to hang
It couldn’t be that the pin that the Yellow led connects to is also connected to the screen? You are sure about your pinouts?
@Jens_Chr_Brynildsen , LCD and Leds are able to work together outside of marlin (if that makes sense). If i use non-timer based methods of controlling the Leds (digitalWrite) then the program works. I am thinking about offloading the LEDS to a separate piece of hardware.
