Don't do it that way! The KL25Z can't directly drive a large LED like that. You'll overload the GPIO port and destroy the CPU.
I hope you haven't tried powering it up in that configuration yet. If you did, you might have overloaded the port, so that port might no longer be working. It's possible to destroy the entire KL25Z by overloading a port, because those GPIO ports are wired directly into the CPU chip, so if you only lost a port, count yourself lucky.
Go here:
http://mjrnet.org/pi...tputsStandalone
And scroll down to this section:
Wiring KL25Z outputs
Look at the diagram and pay particular attention to the box labeled Booster Circuit. That's what you're missing in your current setup. Continue on in the same section for specifics of what you need to hook up.
You otherwise have the LED wiring right. It's just that you can't drive a high-current device like that directly through a GPIO port.
Edited by mjr, 05 June 2024 - 05:13 PM.