Based on the code below, we decided to use 5 IR sensor as input and 2 motor as output. The code for "PWM_test.c" has been shown in previous post. the function of PWM_test.c is to control the speed of the motor in this assignment. PWM_test.c produced rectangle signal to Port 1.0. The code of main body has been shown below. -------------------------------------------- CODE FOR MAIN BODY -------------------------------------------- #include <reg52.h> /* Use reg52.h for header file */ #include "PWM_test.c" /* Call the PWM_test.c in same folder*/ sbit s1=P2^1; /* Declare sensor 1,2,3,4 & 5 to port 2*/ sbit s2=P2^2; sbit s3=P2^3; sbit s4=P2^4; sbit s5=P2^5; sbit R_motor1 = P3^3; /* Declare motor driver 1 & 2 for forward and reverse function to port 3*/ sbit F_motor1 = P3^4; sbit R_motor2 = P3^0; sbit F_motor2 = P3^1; void main () /* main body*/ { P3=0x00; ...