roborio_digital_io
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| roborio_digital_io [2018/01/28 15:01] – [Selecting from among more than two alternatives] tell | roborio_digital_io [2018/12/11 22:31] (current) – [Selecting from among more than two alternatives] tell | ||
|---|---|---|---|
| Line 98: | Line 98: | ||
| - | |||
| - | ====== Selecting from among more than two alternatives ====== | ||
| - | |||
| - | One DIO input can tell the software to do one out of two possible alternatives. | ||
| - | |||
| - | We could use two DIOs for two different limit switches: one for UP, one for DOWN, and if neither switch is closed, we interpret that to mean the mechanism is somewhere in between. | ||
| - | |||
| - | Suppose we want to select from four different autonomous routines. | ||
| - | |||
| - | * 0: Closed, Closed - do nothing | ||
| - | * 1: Closed, Open - drive forward | ||
| - | * 2: Open, Closed | ||
| - | * 3: Closed, Closed - drive forward, turn left, drive, turn right, drive, and then place cube | ||
| - | |||
| - | [picture]? | ||
| - | |||
| - | But requiring the drivers to read the chart, even if it is written on the robot, is error prone. | ||
| - | A better **user interface** would be a rotary switch. | ||
| - | |||
| - | [picture] | ||
| - | |||
| - | A typical rotary switch contains one or more " | ||
| - | |||
| - | {{ : | ||
| - | |||
| - | We can connect a two-level rotary switch like this to encode those four positions into the four possible values for two DIO inputs: | ||
| - | |||
| - | {{ : | ||
| + | What if we want to select between more than two choices? | ||
| ====== Conclusion ====== | ====== Conclusion ====== | ||
roborio_digital_io.1517169683.txt.gz · Last modified: 2018/01/28 15:01 by tell
