Why is the pin logic interchanged ?

11 Mar 2017

Hallo,

I have a seedstudio arch pro. The first blink code does function, I have change the wait times and see the pin logic is not logic to the code.

I mean the code should 0.5s Led ON and 2.0s Led off. Or not?

In real is the Led 0.5s off and 2s on. Why?

#include "mbed.h"

DigitalOut myled1(LED1);

int main() {
    while(1) {
        myled1 = 1;
        wait(0.5);
        myled1 = 0;
        wait(2.0);
    }
}
14 Mar 2017

Hi,

If you see the schematics of the Seeed Arch_pro here, LED's anode connect to 3V3 and cathode connect to GPIO of the MCU via register.

Therefore, led = 0 result LED on and led = 1 result LED off.