function task1_main()
	dac_out_sin()
end

// 模拟量输出正弦波
function dac_out_sin() 
	local chn = 1
	local fDac = 0
	local fMax = 5
	local t = 1
	local fAng = 0
	
	while t > 0 do 
		fAng = fAng + 0.01
		if fAng > 6.2830 then 
			fAng = 0
        end
		fDac = fMax * math.sin(fAng)
		mc.setda(chn,fDac)
		
		mc.delayms(1)
    end
end