Question: How is this programmed in C: Sample input output Please enter sensor value: 1 old state = 1 sensor 1 new state = 3 Please
How is this programmed in C:




Sample input output Please enter sensor value: 1 old state = 1 sensor 1 new state = 3 Please enter sensor value: 0 old state = 3 sensor new state = 5 Please enter sensor value: 0 old state - 5 sensor new state = 5 Please enter sensor value: 1 old state = 5 sensor new state = 3 Please enter sensor value: 2 old state = 3 sensor 2 new state - 1 Please enter sensor value: 4 old state = sensor 4 new state - 2 Please enter sensor value: 5 old state = 2 sensor 5 new state = 2 Good buy! ! ! Process returned @ (0x0) execution time : 83. 129 s Press any key to continue.Write a program that satisfies the state diagram below. The program asks for a sensor reading and decides the next state. (possible sensor inputs are 0, 1, 2, 4) Display the sensor value, current state, and next state. Use a loop to continuously ask for an input until the user quits (entering the number 5 will quit the program). If user inputs a value other than 0, 1, 2, 3, 4, 5 then output a msg. indicating an invalid value and re-prompt the user. The initial state of the robot is 1. 010->2 100->4 Move sensor = 001->1 Straight (1) 010->2 010->2 100->4 Steer Steer Right 001->1 Left (2) (3) 000 ->0 100->4 001 000 Hard Steer Hard Steer Left (4) Right (5) 000->0 000Below are the possible sensor readings: Sensor Binary Decimal Reading Representation Representation 000 0 001 1 010 2 100 4 Possible positions of the mobile robot with respect to the line: Do goalMobile robots are commonly used to transport objects from a start position to a goal position (e.g., warehouse). This can be achieved by line following or wall following. In this activity, we will demonstrate how to implement a simple line following mobile robot behavior. Goal Start Consider the following states of a line following mobile robot: 1. Move Straight 2. Steer to the Left 3. Steer to the Right 4. Hard Steer to the Left 5. Hard Steer to the Right The mobile robot has a line sensor, which is composed of three pairs of light transmitters and receivers. Transmit Receive Transmit Receive White Black
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
