Since digital values are reported on change for any port that is enabled, we could make the callback param for digitalRead optional. However this would require some changes. One change is to enable pin reporting when a pin mode is set to board.modes.INPUT (currently it's enabled upon a call to digitalRead). Then if no callback is specified, immediately return the cached value for the specified pin.
Since digital values are reported on change for any port that is enabled, we could make the callback param for
digitalRead
optional. However this would require some changes. One change is to enable pin reporting when a pin mode is set toboard.modes.INPUT
(currently it's enabled upon a call todigitalRead
). Then if no callback is specified, immediately return the cached value for the specified pin.