oDebounce Object

Back to top of page Description:
 

A Processing Object that stabilizes an input by ignoring its changes for a period of time after it goes to a logical High state.

 The following table lists the size and availability of the oDebounce Object.
 ObjectSizeDescriptionA1A2B1B2C1
oDebounce5 BytesProvides logic-state debouncing functions.xxxxx
Back to top of page Operation:
 

An oDebounce Object takes the oLogic Object that the Input property points and extends the length of its high going pulse it by the amount of time specified by the Period property.

The Operate property determines if operation is active and the Result property is updated. Each time the Result property is updated, its value is also copied to the oLogic Object that the Output property points to. If the InvertOut property is set to 1, then the value of the Result property is inverted before it is copied.

Back to top of page Properties:

The following table lists the properties of the oDebounce Object:

Property

Description

Operate
A value that selects whether or not the Result property is updated.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe operation is not performed.
1cvOnThe operation is performed.
Input
A pointer to an oLogic Object that will be used as the value to debounce.
Object Class: oLogicPtrI Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertIn
A value that selects if the Input Value is inverted before used in the Debounce operation.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertInConstantDescription
0cvFalse

When the value of the oLogic Object pointed to by the Input property is set to 1, the Result property is set to 1 after an amount of time specified by the Period property has passed.

1cvTrue

When the value of the oLogic Object pointed to by the Input property is set to 0, the Result property is set to 1 after the amount of time specified by the Period property has elapsed.

Output
A pointer to an oLogic Object that will be updated with the debounced value.
Object Class: oLogicPtrO Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertOut
A value that selects if the Boolean Result of the debounce operation is inverted before it is stored into the Output oLogic Object.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertOutConstantDescription
0cvFalse

The value of the Result property is copied to the oLogic Object pointed to by the Output property.

1cvTrue

The value of the Result property is inverted before it is copied to the oLogic Object pointed to by the Output property.

Period
A value that specifies the amount of time in 1/60th of a second increments that the debounce operation ignores the Input object's value after it has changed to a logical High state.
Object Class: oVar7 Value Range: 0 - 127
Data Type: Numeric Default Value: 0
Result
The Boolean result of the debounce evaluation. Indicates debounced value of the Input object.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
ResultDescription
0

The Input value has not gone to a Logical High state.

1

The Input value has gone to a logical High state.

Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Examples:
 In the following example, a Virtual Circuit is created that uses the oDebounce Object to monitor a push button switch on I/O line 8.  When the button is pressed, it turns on I/O line 9 for 1 second longer than the button is pressed, if the button is released and then repressed within that 1 second, then the oDebounce will ignore the change and I/O line 9 will stay on while the button was released.
Dim R As New oDebounce
Dim S As New oDIO1
Dim L As New oDIO1

Sub Main()
  ooPIC.PullUp = 1
  S.IOLine = 8
  S.Direction = cvInput
  L.IOLine = 9
  L.Direction = cvOutput
  L.Value = 0
  R.Input.Link(S)
  R.InvertIn = cvTrue
  R.Output.Link(L)
  R.Period = 60
  R.Operate = 1
End Sub

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oRepeatProvides a repeat function.xxx
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.