9 years, 6 months ago.

FRDM KL25Z working backwards

Hi, im using an FRDM KL25Z board, with this code:

#include "mbed.h"

DigitalOut myled(LED1);

int main() {
    
    
    while(1) {
          myled=1;
    }
}

But instead of turning on the led assigned, is turned off. and when i put the following code

#include "mbed.h"

DigitalOut myled(LED1);

int main() {
    
    
    while(1) {
          myled=0;
    }
}

instead of turning off the led assigned, is turned on.

Is something wrong with my board?

Greetings

1 Answer

9 years, 6 months ago.

That's normal. LEDs are pulled-up.

Hi, thanks for the answer, how i do to make working the right way?

posted by Ney Palma 23 Oct 2014

@Ney, look at schematic how they are connected (pull up there), you can change i t to pull down with some tweaking, but is that what you really want?

posted by Martin Kojtal 23 Oct 2014