MbedOs error when reading analog in

Of course, because it doesn’t make sense.

  • your variable aktivan should be declared as volatile bool, that will prevent compilator optimization to a constant value.
  • you can not use the flag like that, because as soon as your flag will be false, then the program end. This loop must be true forever.

as a reference you can use button examples from my old posts

Let me know if you have future question

BR, Jan

1 Like