get() and pressed() are inconsistent terms, as get() is too generic while it only returns one of the two properties of the encoder which have the same importance.
pressed() does not work unless get() is called before it, but this is counter-intuitive. In many real-world situations, users interested just in the button press will forget to add get() first.
Proposal: have an explicit update() method (as suggested for other modules as well) and then have two pure accessors to retrieve data.
As of now, the API for the Modulino Encoder work like this:
There are two problems here:
get()
andpressed()
are inconsistent terms, asget()
is too generic while it only returns one of the two properties of the encoder which have the same importance.pressed()
does not work unlessget()
is called before it, but this is counter-intuitive. In many real-world situations, users interested just in the button press will forget to addget()
first.Proposal: have an explicit
update()
method (as suggested for other modules as well) and then have two pure accessors to retrieve data.