firmware subsystem

View our code on GitHub here. The Arduino communicates with 5 VL53L0X time-of-flight sensors and 10 servos. A switch statement decides, based on the sensor input, how far to turn or bloom the flowers. After a second of no input, the flowers turn back toward the entrance and close, waiting for the next passerby.

Sensors

We communicate with the sensors through I2C. Because the sensors are identical, we assign them unique addresses every time the system starts. We set them to read continuously. In the loop, we read each sensor and set a “triggedSensors” variable to a unique value for any combination of triggered sensors, where triggered means reading within a given set of values. Much of the sensor functionality is accessed through a header file.

Servos

We communicate with the servos through PWM ports. Depending on which sensors are triggered, a switch statement instructs the motors to turn and bloom to different specifications.