Lua syntax error expected '(' near update_rotation

39 views Asked by At

Screen shot of error messageThe syntax error does not appear until I type the = for the variable assignment on the next line. App is Watchmaker.

Complete code

-- Calculate rotation angle based on current time
function update_rotation()
    local current_hour = os.date("%H")
    local rotation_angle = (current_hour / 24) * 360
    return rotation_angle
end

-- Update rotation every minute
function on_minute()
    local rotation = update_rotation()
    your_control.rotation = rotation
end

I am expecting this code to rotate a watch hand around the face once in each 24 hours.

0

There are 0 answers