6 years, 7 months ago.  This question has been closed. Reason: Off Topic

What is going on with Nucleo F103RB and DigitalOut ???

Well... here's the code i've just tried today:

  1. include "mbed.h"

DigitalOut myled(LED1); DigitalOut backLight(PA_12);

int main() {

while(1) { myled =!myled; backLight!=backLight; wait_ms(10); } }

I can see the PA5 port toggling, and not the PA_12... I tried several other ports, it always does the same: stuck to 0.

1 Answer

6 years, 7 months ago.

Hmmm...did you look carefully at your code?

#include "mbed.h"
DigitalOut myled(LED1);
DigitalOut backLight(PA_12);

int main() {

while(1) {
 myled =!myled;
 backLight!=backLight; //Hint:  Look at this line more carefully
 wait_ms(10);
 }
 }

Accepted Answer

I just looked at it for two hours without finding that != is not =!. Should I get more sleep and less coffee ?

posted by christophe MARIN 19 May 2018