First off, huge apologies if this isn't the right area or if I'm not posting my question correctly. I read the stickies, and tried to research my question before asking, but I have to admit I'm stuck because I don't want to kill my motherboard by accident.
Short story is I have a 3d printer that a friend of mine built. Its motherboard is a SAV-MKI, and I would like a light strip to light up when I plug in the printer. Currently I'm controlling the lights through gcode commands sent through OctoPrint, so when I start a print I can get the lights on, but I'd like them to automatically power on from the get-go.
The 5v LED light strip is plugged into pin A4 (and the ground next to it) on the expansion interface of the board, in an IO pin marked as A4 (analog) or A42/44 (digital, depending on if it's teensy or marlin, respectively). I'm using Marlin, so I believe the pin is labeled as 44, based on this code I found in the pins_SAV_MKI.h file:
#define EXT_AUX_A4_IO 44
From what I've read, I can use
pinmode(44,OUTPUT); digitalWrite(44, HIGH);
to make that pin generate power for my LED lights. Here's my questions:
- Is that the right code
- Where do I put it so that it will run on startup but won't affect anything else
This printer uses a very old version of Marlin, I see that the newest version has an excellent "GCode on startup" function I could use, but there are all sorts of dependencies present in this old version that disable functionality of certain things on the printer when I tried to flash a new Marlin version (namely, the heated bed plate didn't heat anymore).
Okay, sorry again if I did anything wrong, please point me in the right direction if I'm way off base. I sincerely appreciate any advice you can all give me, I'm incredibly excited about learning all of this!