Connect encoder motor to OUTPUT for motor M1 (P15 and P16). Counter supply ( green and red wire ) connect to 5V output. Signal wire connect to INPUT P1.
When you press button A, motor starts to rotate. Motor stop to rotate after counter count 23 steps (inpulses). When you pres button B, motor start tu rotate with slower speed. Motor stop to rotate after counter count 76 steps (inpulses). To regulate speed use sleep.
When you press the "A" button on the interface, the propeller must start to rotate in direction A, and when press the "B" button in direction B. Directions A and B depend on the motor connection (polarity).
Connect the RED light to OUT 1 (P16), GREEN to OUTPUT 2 (P15), ON to OUT 3 (P14), and COLOR sensor to input 1 (P1). Connect the sensor power to the BATTERY connector (9V). Use the analogue reading of the input value in the program.
Set the program's operation according to the Input Readings for color matching.
When the COLOR sensor read value for BLACK color, the RED lamp should light. When the COLOR sensor is oread value for GREEN color, the GREEN lamp should light, and when the WHITE color value read (background),WHITE light should light.
LIGHT CONTROLL - POTO sensor (ANALOGUE) - RECOGNIZING BLACK LINE
Connect the RED lamp to OUT 1 (P16), and the PHOTO sensor to input 1 (P1). Use the analogue reading of the input value in the program.
When the PHOTO sensor illuminated (WHITE BACKGROUND) light should be ON. When NOT illuminated (BLACK BACKGROUND), the light bulb needs to be OFF. Set the query values (IF) in the program according to your readings.