10 years, 7 months ago.

Question Regarding the API Summary for APIs in handbook

DigitalOut & operator= (int value) A shorthand for write()

operator int () A shorthand for read()

Could any 1 please tell me the meaning of the above ?

Thanks

1 Answer

10 years, 7 months ago.

That means if you have defined for example: DigitalOut myled(LED1);, that you can write it not only with the 'normal' way, myled.write(1), but you can also do myled = 1; ('operator=' that is).

And the other is the operator int(), that you can do int value = myled;.