Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' The LED is defined as a single I/O line
- Dim Red As New oDio1
- ' Here we create a virtual wire. Wires are
- ' used to link output or flag values to
- ' input values.
- Dim W As New oWire
- ' All OOPic programs need to define a "main" sub-routine.
- ' This is what will be run when the OOPic is turned on.
- Sub Main()
- ' Here we specify the pin number for the I/O line.
- ' The onboard red LED is on pin 7.
- Red.IOLine = 7
- ' The LED can also be used for a button, so we need
- ' to specify whether we wish to read from or write to
- ' the pin.
- ' (cvOutput is a constant value)
- Red.Direction = cvOutput
- ' Now we can set up the wire link!
- ' For the wire's input, we wish to use the built-in
- ' 1Hz timer.
- W.Input.Link(OOPic.Hz1)
- ' Now we send the output of the wire to the LED.
- ' Note that we actually send it to the "Value"
- ' property of the LED, as this is what determines
- ' whether the LED is lit.
- W.Output.Link(Red.Value)
- ' All that's left to do is to tell the wire to
- ' operate, and the OOPic will do the rest!
- ' (cvTrue is a constant value)
- W.Operate = cvTrue
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement