| An Object that controls one of the PIC's I/O lines accessible by the PIC's PWM Module. The Line property specifies which PWM I/O line to use. 0 will access I/O Line 18 and 1 will access I/O Line 17. Once the Line properties set, the Direction and the State properties reference the actual hardware that controls the Direction and State of the specified PIC I/O Pin. The State property references the electrical state of the I/O Pin specified. The Direction property specifies if the I/O Pin is an input or an output. When the Direction property is set to 0 (cvOutput), then the specified Pin will output either 0 or 5 Volts depending on what the State property is set to. When the Direction property is set to 1 (cvInput), then the specified Pin is set to be an input and the State property will report whether or not 5 Volts is being applied to the Pin by an external device. Note that since the Direction and State properties reference the actual hardware of the specified PIC I/O Pin, then changing the Line property will also re-index the hardware that the Direction and State properties reference. This means that you MUST set the Line property BEFORE you set the Direction property for the Direction property to affect the I/O line you want to use. For example, if 1 is specified (Pin 17) and it is an input, then the Direction property would read 1 and the State property would report the current electrical state of Pin 17. Then if the Line property was changed to 0 (Pin 18) and Pin 18 was an output, the Direction property will now read 0 and the State property would report the current electrical state of Pin 18. See other examples below. Note that the oIOLineP Object does not control the PWM module. That job is reserved for the oPWM Object which uses the oIOLineP Object to designate which I/O Line it is going to use. Also note that the Line property is the default property. This means that if an instance of the oIOLineP Object exists, then not only can the Line property be set to 1 by assigning it with the statement "IOLine.Line = 1", it can also be set with the statement: "IOLine = 1" as demonstrated in the oPWM Object. |