Question: ( write Program according to this ) : 1 . If Slide switch is Low then DC Motor should stop, RGB LED should be Off

(write Program according to this):
1. If Slide switch is Low then DC Motor should stop, RGB LED
should be Off and Ultrasonic should not be active. Display
on first row of LCD Rest.
2. If slide switch is HIGH then:
a. Input and calculate the distance of Object from
ultrasonic sensor in CM.
b. If distance is more than 100 cm then:
i. Rotate motor in clockwise direction.
ii. Switch on the RGB led in green color.
iii. Display on the first row of LCD Away.
iv. Display on 2nd row the value of distance in cm.
c. Else If distance is more than 50 cm the:
i. Rotate motor in Counter clockwise direction.
ii. Switch on the RGB led in Blue color.
iii. Display on the first row of LCD Near.
iv. Display on 2nd row the value of distance in cm.
d. Else:
i. Stop the motor movement.
ii. Display on the first row of LCD Stop.
iii. Toggle the RGB led colors from red to blue to
green with a delay of 300ms.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!