Welcome! Log In Create A New Profile

Advanced

How to wire LED_PIN ?

Posted by DaHai8 
How to wire LED_PIN ?
August 29, 2020 12:34AM
pins_MKS_SGEN_L_V2.h lists:

#define LED_PIN                            P1_18  // Used as a status indicator

I want to use this to turn on/off a 5v LED via
M42 S1
M42 S0

But I can't find anywhere if this is the V+ or GND pin. So I don't know where to plug in the other wire.

I thought of may using the Servo pins for this with P1.23 and 5V, but now I'm thinking that might fry something.

#define SERVO0_PIN                         P1_23  // SERVO P1.23


Suggestions?
Re: How to wire LED_PIN ?
August 29, 2020 02:16AM
"But I can't find anywhere if this is the V+ or GND pin"

IO pin flip from gnd to their vcc (3.3v in this case)

IO pins can both source and sink current. So can be used as a + or a gnd pin.
but care must be taken not to exceed their source or sink limits for the pin (not all pins are equal)

If you want the led to be on when the IO pin is on, your using the pin as source, the other led leg should be grounded.

If you want the led to be on when the IO pin is off, your using the pin as a sink, the other led leg should be on vcc.

Most IO pins on the LPC1768/9 are 5v tolerant when in IO mode (not when analog mode)
But not all...

When you dealing with electronics is always best to check the datasheet [www.nxp.com]
search for P1[18] and P1[23], both are 5v tolerant.

Also remember that LEDs have polarity. It only works one way around.
Re: How to wire LED_PIN ?
August 29, 2020 03:48AM
Thank you very much!
That makes a lot of sense now.
Sorry, only registered users may post in this forum.

Click here to login