Skip to content

Encoder returns 0 improperly #29

@jack-dundas

Description

@jack-dundas

readEncoder() returns a variable saved to the mm object.
When mm is initialized, it initializes this variable to zero.
This variable is updated once mqtt publishes to the encoder topic.
Therefore, if the client tries to readEncoder before the encoder topic has been published to, it will wrongly return a value of 0. 0 represents the unitiliazed object rather than the actual encoder value

This can be fixed using "subscribe_simple" and asking for retained messages

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions