An example of writing code using a "Virtual Circuit"
This is an example of writing a program in Basic syntax that uses a Virtual Circuit. It creates a "Virtual Circuit" by connecting two Input Lines to the inputs of a "Virtual" and-gate and connects an Output Line to it's output.
Create a new instance of each Object needed with the DIM command, specifying a meaningful name for each Object instance. Dim Button1 As New oDIO1
Dim Button2 As New oDIO1
Dim RedLed As New oDIO1
Dim AndGate As New oGate(2)
Specify which I/O lines each of the Objects will use and specify which Objects are inputs and which are outputs by assigning values to Object properties. Button1.IOLine = 1:
Button1.
Direction = cvInput
Button2.
IOLine = 2:
Button2.
Direction = cvInput
RedLed.
IOLine = 3:
RedLed.
Direction = cvOutput
Assemble the Virtual Circuit by Connect the Objects together using the Link method. AndGate.Input1.Link(Button1.Value)
AndGate.
Input2.Link(Button2.Value)
AndGate.
Output.Link(RedLed.Value)

Our program can now go do other things while the RedLed object is continuously updated.

This screen shot shows this virtual circuit program typed into the OOPic Development Software.

NOTE: The "Virtual Circuit" your program defines within the OOPic operates at an average speed of 100,000 operations per second..


Home   Send mail and comments to: Savage Innovations.