Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

Stop command after 1 min and enable the command after 5 min?

$
0
0
Dear all,

I have a problem as following expression
I am building the VB code for automatically heater

The heater turn on when temperature in room is lower than 17oC.
However, I just want it turn on in 1 min then it has to turn off
After 5 min, the system will check temperature again and the heater will turn on or off depend on the temperature.

I can set it in range as this:

Private Sub Timer1_Timer()
If Check1 = 1 Then
If Check6 = 1 Then

If tem2.Text < 17 Then
MSComm2.Output = "a"
HeaterCheck1 = 1
End If
If tem2.Text > 18 Then
MSComm2.Output = "A"
HeaterCheck1 = 0
End If

End Sub

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>