[SOLVED] Adafruit Trinket 5V LED Blink Not Working

Hello everyone. First off, sorry for this extremely basic question, I’m quite new to Arduino in general. Recently I bought an “Adafruit Trinket - Mini Microcontroller - 5V Logic” to do a project involving transmitting and receiving 315Mhz to find a lost item by having the receiver attached to the lost item make a sound when signaled to. Obviously, I decided to start off with a smaller project and work my way up so I could understand what I was doing. So the very first thing I tried was to make an LED blink. I attached a wire from the #2 pin of the Trinket to a resistor to the long leg of the LED, and then attached the Ground pin to the short leg of the LED. I triple checked the wiring and it is fine. Then for my code, I found this online:

int led = 2;


void setup() {
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);
 
}
 

void loop() {
    digitalWrite(led, HIGH); 
    delay(1000);
    digitalWrite(led, LOW);
    delay(1000);
}

Finally, I ran the code and it said successfully uploaded. Yet the LED does not blink! I am losing my mind over this, I cannot find a solution why it wont work. The built-in LED on the Trinket blinks, but not an external LED. I am very confused. I tried two different Trinkets, multiple LEDs, multiple wires and resistors, but nothing seems to work. On the other hand if I use a 5V battery pack, the LED turns on. Pleaes help me, thank you.

Try re-writing your code to use pin 1 instead of pin 2. The built-in LED is attached to pin 1, so you won't need any external circuitry. The LED next to the USB connector that isn't the power lamp should blink. Does it?

I just re-read your post, and it appears that you did this and it did blink, is that correct? In that case, move the wire that plugs into the pin 2 strip of the breadboard to pin 1. Does the external LED work? If not, the LED or perhaps one of the dupont connectors, or the breadboard strip is bad. If it does work, then the breadboard strip on pin 2 could be making poor contact, or pin 2 has been ruined by too much current. Did you ever do digitalWrite(2, HIGH) when it was grounded? I did that to a trinket once, and that pin never worked right again.

The breadboard or Trinket cannot be broken because I tested the LED with a 5V battery on the breadboard and it lit up. Also of the 2 Trinkets, I have never done DigitalWrite(2, HIGH).

(deleted)

spligit:
The breadboard or Trinket cannot be broken because I tested the LED with a 5V battery on the breadboard and it lit up. Also of the 2 Trinkets, I have never done DigitalWrite(2, HIGH).

Well, does the external LED blink if you write it for pin 1?

I have to solder the Trinket pins in? They fit in very snug and if I use the ground pin and 5V pin it powers the LED so that cannot be the problem. The external LED does not blink if I write pin 1.

(deleted)

Excuse me? I can show you a picture of it working

(deleted)

spligit:
I have to solder the Trinket pins in? They fit in very snug and if I use the ground pin and 5V pin it powers the LED so that cannot be the problem. The external LED does not blink if I write pin 1.

Well, there's yer problem.

How would one even go about doing that?

He is using a breadboard, not just stuffing wires into holes where header pins woild be soldered. Breadboard sucks, and I don't use it because of how flaky it can be - but it should be usable, at least when new....

What was shown above should work, though, assuming the led is the right way around. Which I supposeis why people are questioning the breadboard.

In that case, humor us and flip your LED around.

The LED is the right way. I checked the Trinket pin lengths and they are the same as the male/male wire pin lengths, so the breadboard is not a problem if the Male/Male wires work using the same pins.

I fixed it! I messed around the positioning of the Trinket for a couple minutes. And at some point I slanted it down and LED started blinking. It is super weird, but it only blinks if it is slanted down. I am so confused. Does this mean I should solder the pins to the Trinket?

Here is a video showcasing what I meant in the above message ^

(deleted)

I am sure it connects to the breadboard. You said the breadboard connection was off, it wasn't. The connection that was off was between the pins and the Trinket. So I was correct.

That is exactly what they suggested - that the connection between the breadboard and some wire or pin that you have connected to it was bad.

This is why many of us hate breadboard. When it's fresh, most breadboard works well enough. But older breadboard, or holes in the breadboard that have had bigger diameter pins pushed into them will get unreliable - leading you to waste tons of time debugging issues that turn out to be loose connections to the breadboard - and it's hard to tell whether breadboard has "gone bad" until you spend hours debugging something that turns out to be a bad connection.

The first thing I would do is chuck that breadboard in the trash - you've just demonstrated that it's a bad one. It may be possible to find a new production breadboard (yours looks old - I notice the plastic looks a bit yellowed) that works better - but you'll get much better results with actual soldered connections.

I have had good luck with female dupont line connecting to male pin header (like the pin header on the trinket); If you're connecting to things that don't have 0.1" pin header on them, you can wire it up on a little piece of prototyping board, with soldered connections.
Here's an example of what I mean - it comes from my own shop, so obviously it's the best stuff available. I've got it in sizes from the tiny ones this link is pointed to, to sizes up to 2" x 4" and 4" x 4".:

Showing how you might use it (this is a barebones arduino on protoboard)

Male dupont connectors are much worse than female ones - they're unreliable - or at best fiddly - whether you plug them into female pin header, breadboard, or even female dupont connectors.

Do you know how to solder? Do you have a temperature controlled soldering iron? Be sure to get a temp controlled one - the really cheap ones aren't temp controlled, and get too hot, leading to damage to the board you're soldering. I recommend 60-40 or 63-37 rosin core solder (not the lead-free crap)