You can use a timer...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbcontimercontroloverview.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconlimitationsoftimercontrolsintervalproperty.asp
'Basically, dimension the timer on your form
Friend WithEvents Timer As System.Windows.Forms.Timer
'Create the timer in InitializeComponents() and set the interval on the timer
Me.Timer = New System.Windows.Forms.Timer(Me.components)
Me.Timer.Interval = 6000
'Enable it when you load your form
Timer.Enabled = True
'put your code to do something fun in the Timer_Tick event
Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer.Tick
'fun code here
End Sub
Or you can use Thread.Sleep in a loop. This will halt execution for
the specified time
Do
'Code here
Thread.Sleep(10000) 'number of milliseconds
Loop Until bDone
On 7/22/05, Matthew Macdonald-Wallace <[EMAIL PROTECTED]> wrote:
> Matthew Macdonald-Wallace wrote:
>
> >Hi all,
> >
> >I'm currently writing a program to control a device over the parallel
> >port using a slider control. (it's a small motor that runs over the 5v
> >+ve line), however although it is fine powering on and increasing the
> >speed, it won't decrease.
> >
> >I've included the relevant source code below and look forward to hearing
> >how to get this. I'm sure it's easy, but I'm just not sure how to do it!
> >
> >Cheers,
> >
> >Matt
> >
> >
> OK, I've now solved this issue, what I now want to do is send a pulse
> over the port.
>
> I assume that I need to use a timer to do this, but I'm not sure how to
> go about it.
>
> I want it to do the following:
>
> turn the light on for a specified period, turn it off for a specified
> period, loop.
>
> so for example the light would do the following:
>
> 0 1 0 1 0 1 0 1 ...
>
> Thanks in advance,
>
> Matt
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/