October 2019
Intermediate to advanced
350 pages
9h 5m
English
Let's create the mappings to have a more readable output. Instead of, for example, 1, 1, 1, 1, we want to have an output such as Standing on: bottom or Standing on: left side. Follow the steps to add side detection to your cube:
1 1 1 1: Side 0 (Bottom)0 0 0 0: Side 1 (Top)0 1 0 1: Side 21 0 1 0: Side 31 1 0 0: Side 40 0 1 1: Side 5
By looking at the number combinations, you can see that either all pins are 1 (bottom side), all pins are 0 (top side), or two pins are 0 and two pins are 1. Each side has a different combination of tilt switch readings.
Read now
Unlock full access