Hey guys. I’ve run into a roadblock. The if loop within the draw function is not working as it’s supposed to. Please help.
The loop runs only once, but it’s supposed to keep running as long as the condition remains true.
-- Test
-- Use this function to perform your initial setup
function setup()
temperatureGauge = {}
parameter.watch("temperatureGauge.green")
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
-- This sets the line thickness
strokeWidth(5)
-- Do your drawing here
temperatureGauge.green = 246
if temperatureGauge.green > 12 then
temperatureGauge.green = temperatureGauge.green - 6
end
if temperatureGauge.green <= 12 then
temperatureGauge.green = temperatureGauge.green + 6
end
end