Inverted polarity GND and PIN13

Hello, is possible to somehow invert gnd and pin13 polarity? I was experimenting with Arduino MEGA yesterday and can't run RGB led anymore if attached to GND and PIN13 PIN12 PIN11, before was ok (I was mixing colors etc.), now seems that GND is not GND anymore. One more thing small yellow SMD led on board marked as L now is switched off when LED is on, before was if LED on then that small led on board as well on. Any ideas?

P.S. Other PWM's the same problem.

Hi, it's not possible for the pins to become inverted hardware wise but pin 13 could be inverted if you have altered any of the library's for pin13 to be !pin13, people correct me if im wrong, my experience is with PIC's, I just got a Duino recently to play with.

If I swap LED pins then it is working properly, but I can't control RGB led then. If what you saying is true do you know how to fix it?

It's somewhat unclear what you are experiencing. If you could post your code and wiring of the LED, I'm sure someone can help. Did you use current limiting resistors for your LED?

Lefty

ok, at the moment I'm using this code only for one LED, also I'm using 270ohm resistor (red, blue brown, golden):

int ledPin =  13;

void setup()   {                
  pinMode(ledPin, OUTPUT);     
}

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

basically I have to swap LED pins to get same result, but then I can't control RGB via PWM's (keep in mind that code above just for example I'm not controling three LED's with it) Somebody told me that I'm connecting everything wrong, but before was ok :o

I'm new with Arduino :)

Somebody told me that I'm connecting everything wrong,

Correct, it's wrong. A common anode LED would have to have the anode wired to a positive voltage, +5vdc in your case. Each of the three cathode leads would have to wire to a series resistor (like you have) and then to each of the three Arduino digital output pins you are using. The logic would then be when the pin is set LOW the LED element would light up, and go off when the pin is set HIGH.

Lefty

I agree with you, but strange that it was working somehow before :) Have you got any scheme to connect this LED to arduino in different way? +5v source is from power pins next to analog pins? I swear I didn't use any additional power source before and was working fine

+5v source is from power pins next to analog pins? I swear I didn't use any additional power source before and was working fine

Yes, the 5V pin on that Arduino connector can wire to the common anode of your LED device. If it was working before it's because you somehow had a positive voltage to the anode (maybe you had the anode wired to a digital output pin that was HIGH output?, who knows), it can't light up with a ground wired to the common anode.

Lefty

It sounds mystic for myself :) Thanks for help, I thought my Arduino burned :)