View Single Post
  #6   Spotlight this post!  
Unread 11-02-2008, 10:48
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Automated Air Compressor code

Quote:
Originally Posted by Kingofl337 View Post
The function of InitPressureSwitch is to turn on the compressor when the air pressure falls below the maximum air pressure as indicated by the pressure switch.
That sounds both confusing and unhelpful. First, shouldn't it turn on the compressor when the pressure falls below the minimum? The pressure switch doesn't give a "falls below maximum" indication. Second, you still haven't made it clear whether InitPressureSwitch has to be called regularly in order for it to work, or whether the single call in the Initialize function will set up some hidden background code to handle the compressor automatically without any further user action.

Naming it beginning with "Init" implies that it is intended to be run only once, at the start of the program. The name also implies that it initializes things that need to be processed later, but there doesn't seem to be an associated "ProcessPressureSwitch" function. Perhaps the tutorial explains the proper use, though I don't recall seeing anything about it.