Question: Programming Assignment: Must be submitted Please note that all the programming assignments in this courses are for the mbed board with LPC1768 microcontroller that is
Programming Assignment: Must be submitted Please note that all the programming assignments in this courses are for the mbed board with LPC1768 microcontroller that is referred to in the text book and is used for labs. 1. Write a C program to control an autonomous robot. It runs on two wheels, each wheel connected to a DC motor. If both wheels run at the same speed, robot moves forward. If the right wheel runs slower, robot makes a right turn. There are two sensors mounted on the robot that can detect an obstacle, one in the front, one on the right. Once the robot is turned on, it moves forward at 80% of the maximum possible speed, when an obstacle is detected in front, if there is nothing blocking on the right side; it slows down to 40% of maximum speed and then it makes a right turn. Unless there is an obstacle on the right side too, then the robot will stop. You must use PWM to control the wheels. The sensor outputs are digital, the mbed board will detect low when no obstacle and will detect high, when there is an obstacle. This is pin conn for this robot. Right wheel pin 21 Left wheel pin 22 Front sensor pin 10 Right sensor pin 11 Use a flowchart to show the algorithm of your program. Write a C program that turns on the following LEDs depending on the input voltage that is applied to pin 20 as shown in the table. VnLED that is on 2. None LED1 LED2 LED3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
