Discussion forum for the BasicX family of microcontroller chips.
|
This routine locks after a few day's so Pinker stay's 1! If Timer>TimerTempB+1.0 then If Pinker=0 then Pinker=1 ElseIf Pinker=1 then Pinker=0 End If TimertempB=Timer End If I use this to blink a output. |
|
|
|
You need to catch the timer overflow / reset at midnight add ElseIf TimerTempB > Timer then TimerTempB = Timer + 1.0 End If Ian petervanlievenoogen wrote: > This routine locks after a few day's > so Pinker stay's 1! > If Timer>TimerTempB+1.0 then > If Pinker=0 then > Pinker=1 > ElseIf Pinker=1 then > Pinker=0 > End If > TimertempB=Timer > End If > > I use this to blink a output. > > >. > . [Non-text portions of this message have been removed] |
|
From: "petervanlievenoogen" <> > This routine locks after a few day's > so Pinker stay's 1! > > If Timer>TimerTempB+1.0 then > If Pinker=0 then > Pinker=1 > ElseIf Pinker=1 then > Pinker=0 > End If > TimertempB=Timer > End If > > I use this to blink a output. This could easily be a Cinderella problem. If the code runs within one second of midnight, it's possible TimerTempB doesn't get reset during the next cycle because Timer wraps to zero. Once that happens, Timer may never get to be greater than TimerTempB + 1.0, so Pinker stays constant. -- Frank Manning -- NetMedia, Inc. |