Connecting the Blocks
Left Motor Control
-
Input:
-
IO69 (left line sensor) connects to the select input of the first demux2.
-
The constant value 1 is connected to the in input of the demux2.
-
Outputs:
-
outa: Connected to IO57.
-
outb: Connected to IO56.
-
How it works:
-
If the left sensor detects no line (select = 0), the constant 1 goes to outa (IO57).
-
If it detects the line (select = 1), the signal is routed to outb (IO56).
Right Motor Control
-
Input:
-
IO68 (right line sensor) connects to the select input of the second demux2.
-
The constant value 1 is connected to the in input of the demux2.
-
Outputs:
-
outa: Connected to IO55.
-
outb: Connected to IO54.
-
How it works:
-
If the right sensor detects no line (select = 0), the constant 1 goes to outa (IO55).
-
If it detects the line (select = 1), the signal is routed to outb (IO54).
General Behavior
-
The demux blocks determine which motor action is taken depending on the line detection:
-
outa and outb can be configured to drive the motor forward, reverse, or stop depending on the control logic applied externally (e.g., H-bridge control).
No Comments