var_bez=0

function setbez()
     if var_bez==1 then
        var_bez=0
     else
        var_bez=var_bez+1
     end
end

tweens.rotate=360

function rotate_tick()
  wm_schedule {
    action='tween',
    tween='rotate',
    to=tweens.rotate-6,
    duration=0.3,
    easing=outQuad }
    tweens.rotate=tweens.rotate-6
end

function rotate_min()
if tweens.rotate<={drm} and tweens.rotate>0 then
 wm_schedule {
    action='tween',
    tween='rotate',
    to=0,
    duration=1.5,
    easing=outQuad }
    tweens.rotate=360
else
if tweens.rotate>{drm} then
 wm_schedule {
    action='tween',
    tween='rotate',
    to={drm},
    duration=1.5,
    easing=outQuad }
    tweens.rotate={drm} 
else 
if tweens.rotate==0 then
   tweens.rotate=360
 wm_schedule {
    action='tween',
    tween='rotate',
    to={drm},
    duration=1.5,
    easing=outQuad }
    tweens.rotate={drm}
end
end
end
end

function rotate_reset()
if tweens.rotate>0 then
  wm_schedule {
    action='tween',
    tween='rotate',
    to=0,
    duration=1.5,
    easing=outQuad }
    tweens.rotate=360
else
    tweens.rotate=360
  wm_schedule {
    action='tween',
    tween='rotate',
    to=0,
    duration=1.5,
    easing=outQuad }
    tweens.rotate=360
end
end