Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 1 month 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
11 years, 1 month 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;.