XV11 LIDAR icon XV11 LIDAR Real-time 2D mapping from Neato XV-11 360° LIDAR via GetSurreal controller; exports $LIDARDistance/$LIDARIntensity, configurable angles, color, zoom. Try it →
Asked — Edited
Resolved Resolved by DJ Sures!

Executing Functions At A Specific Time Interaval

I am trying to write a script that does a specific function at 15 minutes, 30 minutes, and 1 hour. I cant figure out how to write it so if 15 minutes it resets that time, and continues to count until 30 minutes, and then an hour. Does anyone have an example of such a script.

Thanks.


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#1  

$loopCount = 0

:loop

$loopCount++

sleep(1000 * 60 * 15)

IF ($loopCount = 1)

  say("15 minutes has expired")

ELSEIF ($loopCount = 2)

  say("30 minutes has expired")

ELSEIF ($loopCount = 3)

  say("45 minutes has expired")

ELSEIF ($loopCount = 4)

  say("60 minutes has expired")

  $loopCount = 0

ENDIF

goto(loop)
Author Avatar
PRO
USA
#2  

Very cool! Thanks.