Skip to main content
12 events
when toggle format what by license comment
Apr 19, 2019 at 10:50 history edited Filip Franik CC BY-SA 4.0
added 8 characters in body
Apr 19, 2019 at 10:49 comment added Filip Franik I did a little simulation and Serial.println((TestEnum)false); prints 0 and Serial.println((TestEnum)true); prints 1 so cast looks good. I will adjust my answer. If it will fail on OPs board I will delete it.
Apr 19, 2019 at 10:40 comment added Juraj cast to PinStatus could work. it compiles, but I would like to know if it works. but I don't have a board which would use the updated Arduino API. but the enum could be tested on it's own.
Apr 19, 2019 at 10:36 comment added Filip Franik @Juraj You got me. I was reading wrong source code, and tested it on wrong simulator. Post answer about using ternary operator and I will delete mine.
Apr 19, 2019 at 10:27 comment added Juraj for megaAVR core (Uno WiFi 2) with PinStatus enum?
Apr 19, 2019 at 10:21 comment added Filip Franik @Juraj Strange. Line digitalWrite(9, (int)!digitalRead(8)); works perfectly in Tinkercad.
Apr 19, 2019 at 10:19 comment added Juraj if you write an answer, why you don't try it? the cast to int doesn't compile
Apr 19, 2019 at 9:59 history edited Filip Franik CC BY-SA 4.0
added 7 characters in body
Apr 19, 2019 at 9:29 history edited Filip Franik CC BY-SA 4.0
edited body
Apr 19, 2019 at 8:12 history edited Filip Franik CC BY-SA 4.0
added 313 characters in body
Apr 19, 2019 at 7:56 history edited Filip Franik CC BY-SA 4.0
edited body
Apr 19, 2019 at 7:50 history answered Filip Franik CC BY-SA 4.0