Let's code the door to open under certain conditions
Let's first find out the number of rotations needed to open and close the door completely. Keep the motor power at 30% only. We will need the following number of rotations:
__________ rotations to open the door fully
__________ rotations to close the door fully
Great! Now, do the setup of your automatic door and the color-coded man, as shown in the following screenshot. Identify the right place for the man to stand so that the color sensor can detect the colors accurately. The sensor should be able to sense the color of the hat:
Let's first understand the basics of the color sensor and how it works. Your BOOST kit's color sensor can detect six different colors: red, blue, green, yellow, black, and white. It can detect color from a maximum distance of 3 cm. Let's now learn how to code. For sensor-based programming, the first...