View Single Post
  #6   Spotlight this post!  
Unread 07-02-2017, 08:14
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 124
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Code for Ultrasonic Sensor

In a command based robot, I would be tempted to refactor the example into its own Subsystem.

However, this could be thought of as a special "read only" type of subsystems. Commands that made use of this subsystem would not need to require() it in their constructors as there isn't a problem if multiple commands take distance measurements at the same time. If two commands both want to get distance measurements, it isn't a problem like it is if two commands both want to manipulate drive motors.

Alternatively, I might be tempted to leave it as its own stand alone class (not make it a subsystem) and just use it as is.
Reply With Quote