In version 6.0, the objects have been reorganized into functional hierarchies. Compare the version 5 oDCMotor property list to the one in the new version 6 compiler:  The first thing to notice is that all of the properties are in terms that directly relate to the motor itself. Speed, Brake & Operate can all be used to describe the behavior of the motor. While the I/O line properties don't describe a motor behavior, they are directly associated with the hardware that is connected to the motor.The second thing to notice is that all of the properties are objects. (Objects that you can use in your own programs.) The third thing to notice is that the properties that controlled the H-Bridge and the PWM are no longer on the list. Instead there is an object called H-Bridge in the list. It is an H-Bridge object. Like the oDCMotor object, it has its own set of properties. The properties that controlled the H-Bridge are now in its property list. 
Notice that there are more properties listed here for the new H-Bridge object than were listed for the H-Bridge functions in the version 5 oDCMotor. With all of the H-Bridge functions encapsulated in an object, the H-Bridge is now a complete object that can be used in your program. Also notice that all of the properties are in terms that directly relate to the H-Bridge itself. Within the H-Bridge Object, notice that there is an object called PWM. Yet again, the PWM functions have been encapsulated into a self contained and complete object that you can use in your programs. 
The hierarchical arrangement provides a simplified approach to the top level object while providing greater control of the minute details. For example. When an oDCMotor is created, it automatically initialized all the properties of the H-Bridge Object for you. The H-Bridge automatically initializes all the properties of the PWM Object as well. All that is absolutely necessary to get the motor to operate is to interact with the top-level properties. As for the other properties that are no longer on the top-level, each property associated with a particular function will reside within that function, therefore eliminating the confusion of what properties control what functions. For example, if you wanted to change the Prescale property of the PWM that is being used by the H-Bridge that is being used by the oDCMotor Object, you simple drill down to it.
Motor.HBridge.PWM.PreScale = NewValue
In such a statement, you are literally specifying which sub function of which function you are referring to which increases the readability of your program. |