7 years, 9 months ago.

the new mbed library appears to be bugged

On my mbed compiler account I have a few examples I imported a few months ago. Yesterday I wanted to clone my blink LED program to make some modifications to it. But instead of cloning, I created a new library and copy/pasted my old main.cpp content. I noticed something strange, the example didn't worked. The LED1 was always ON. After a few hours of debugging I come to the conclusion that mbed.h library is the problem. The old library, from a few months ago has 30 Mar 2016 as the modified date and the new library has 26 May 2016 as modified date. The platform is STM32F030R8T6 and the code is this:

blink LED

#include "mbed.h"

DigitalOut myled(LED1); // onboard led

int main() {
    while(1) {
        myled = 1;
        wait(0.1);
        
        myled = 0;
        wait(0.1);
        
        myled = 1;
        wait(0.1);
        
        myled = 0;
        wait(0.1);
        
        myled = 1;
        wait(0.1);
        
        myled = 0;
        wait(0.1);
        
        myled = 1;
        wait(0.1);
        
        myled = 0;
        wait(1.0);
    }
}
Be the first to answer this question.