For project 3, Berio and I decided to use 4 DC motors, 4 LEDs, and 4 LDR sensors. Each motor has a LED attached to it. The sensors are used to determine the speed of the motor and the delay between the cluster of blinks on the LED. The more light being detected by the LDR means that the speed decreases and the delay between blinks is longer, the less light means the speed increases and the delay between blinks is shorter. We used delay() for testing a single motor because it saves time and doesn't require additional programming, but when adding the other 3 motors, we had to switch over to millis(). The millis function requires a minimal amount of additional coding in order to get it to work.
No comments:
Post a Comment