defineProperty("frame_rate_period",globalProperty("sim/operation/misc/frame_rate_period"))
defineProperty("elevator_trim",globalProperty("sim/cockpit2/controls/elevator_trim"))
defineProperty("trim_wheel_moving",globalProperty("giv_dataref/trim_wheel_moving")) 

local time_passed = 0
local trimpos = get(elevator_trim)


function update()
time_passed = time_passed + get(frame_rate_period)
if (time_passed >= 0.25) then 
   if (trimpos ~= get(elevator_trim)) then
        set(trim_wheel_moving,1)
		time_passed = 0 
		trimpos = get(elevator_trim)
      else
	    set(trim_wheel_moving,0)
		time_passed = 0
		trimpos = get(elevator_trim) 		
   end

end
end