- To figure out what was going wrong, Davina hooked the Arduino back up to a simple LED circuit and used the LED as a visual indicator of code function. This works directly with the PlantParent control application because the application is functionally identical to an application that controls blink-time of an LED. Previously, some cursory tests with an LED had revealed that it behaved in accordance to the actual settings on the computer; this made no sense, because due to the electrical system's wiring error, the programming should have been set up to make the LED behave in reverse of the settings.
- The problem that Davina identified was that the on, off, and corresponding delay statements were mixed up and used the wrong integers sent from the computer application. This resulted in the on-times and off-times being switched. The error is highlighted in Figure 1 below.
|Figure 1. Mixup of on ("LOW") and off ("HIGH") statements in Arduino code, and subsequent solution.|
- This was also probably the source of the inability to terminate the program - which is what had been happening. Since the termination command simply breaks the on-off loop, the program reverts back to the first setting of the output pin. While it was mixed up, the first setting was on, so clicking "Cancel" made the pump run indefinitely instead of turning it off.
- There had also been a mix-up of the variable names in the Qt application, which Davina had fixed on Wednesday, but had previously been compensating for the error above. This was something like a triple-negative sort of logic that got reduced to a double-negative, and is now down to one negative as it should be.
- The team found that while at least partially immersed in water, the pump would continue to deliver water through the plastic tubing even when unplugged. This was very confusing at first, but eventually Michelle realized that in blocking one hole and using the other as the single output, the team had essentially created a vacuum inside the pump, which allowed the water to flow through without any mechanical impetus other than air pressure.