After finishing up the main logic code that would be used I found a few areas where I ran into some issues.
The first thing was naming of functions and vs what they actually did. For example, turnOnServo tells me nothing about what it turns on, it just moves to x position. As the servo is the major part of the control and attached to the valve, a more appropriate name was openValve() and it's companion, closeValve(). This makes more sense for it's function and thus will make it more readable.
This also brought up an issue with the testing env(test system vs final system differences)....something I hadn't considered was bad hardware.
Finally, the testing of the valve itself. As I had done initially tests with it unattached to the servo, I hadn't fully tested it with the settings and the servo throws aside from a dry run.
So after this initial bumpy start, I brought the gear back in to do a bit of a rework....

No comments:
Post a Comment