Help needed please!

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
julian147
 
Posts: 1
Joined: Mon Nov 14, 2022 7:13 am

Help needed please!

Post by julian147 »

Hello every one. I’m not sure if I’m even posting this in the right section, but I’m fairly new to all of this. For my project I have two LED’s that I want connected to the same power source, but I want each one to be activated by its own switch. It’s for a nerf Stryfe blaster mod. I’ll have one LED that’s activated by a lever switch when the magazine is inserted and another LED that’s activated by a Hall effect sensor to indicate when the darts have run out. I want them to be connected to the same power source.. how can I go about doing this as simple and compact as possible?

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Help needed please!

Post by dastels »

It really depends what you want to do. To just turn an LED on and off wire the anode of the LED to power (5v or whatever), the cathode to one side of a current limiting resistor (which will depend on the voltage you are using... see https://learn.adafruit.com/all-about-leds). The other side of the resistor is wired to one side of the switch. The other side of the switch is connected to ground. With the hall effect sensor you'll need to get a bit more involved and use a transistor to switch the LED.

If you want something more than just turned them on/off you'll want to get a microcontroller in the mix, using it to read the switched/sensors and control the LEDs as appropriate.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”