Pico help config


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 2085
Posted: 09:40am 22 Oct 2021      

Hi Lewis,

  lew247 said  
if VAL(Speed2$) < 3 then
 Minute = Val(Mid$(TIME$,4,4))
 print Minute
 if Minute = Minute + 1 then
 print "time is up"
END IF


How would Minute ever equal Minute + 1 ?

Untested, but does this work ?

Dim start%, now%

...

If Val(Speed2$ < 3) Then
 now% =  Val(Mid$(Time$, 4, 4))
 If start% = 0 Then
   start% = now%
 ElseIf now% >= start% + 1 Then
   Print "Time is up"
 EndIf
Else
 start% = 0
EndIf


Though you should probably be using values returned by Timer rather than Time$.

Best wishes,

Tom