Skip to content

Wheel Encoder Blocks

Alan Yorinks edited this page Aug 30, 2015 · 5 revisions

standardfirmata

Each wheel motor has an attached encoder, and as the wheel turns, it generates a continuous stream of "ticks". One full wheel revolution results in 192 ticks. By using the tick counts, you can determine how far the RedBot travelled.

Encoder Count Blocks

These oval blocks accumulate the number of ticks generated as each wheel turns. They are reporter blocks and can be assigned to a Scratch variable.

Reset Encoder Count Blocks

These rectangular command blocks allow you to reset the tick counts for each wheel back to zero.

When Encode Count Blocks

These "hat" blocks will continuously monitor the number of accumulated ticks for its associated wheel. When the number of ticks exceeds a user specified value, the blocks attached to this block will execute.

See the "Quick Test Program" for a usage example.