Connect the ULTRASONIC sensor to the 3.3V supply (red and green). Connect the signal wires to the input P0 (blue) and P3 (black).
Connect the right motor to the motor outputs M1 (P15 and P16), and the left at the motor outputs M2 (P13 and P14). ADD package "SONAR".
When the ULTRASONIC sensor finds an obstacle, the vehicle should go back for a certain time (500 ms). The RANDOM decision requires the program to select the direction of the vehicle. After the vehicle moves to the chosen side, it moves forward again.
Connect encoder motor to OUTPUTS 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 pause.
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 OUTPUT P8. Add "digital write pin P8 to 1" on start after "led enable". 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. Base should be illuminated. You can do a test by turning the sensor towards the light.
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.