capacitor1
Member level 3
Hi!
I have an angle in the microcontroller from 0 to 360 , and I want to calculate its Sin , and display this number as analog .
I use CCS compiler , and I think that the Math library exists.
the hard thing how to convert the number from 0 to 1 ( if we neglige the negatif numbers ) , and with 3 digits after the point . (0.000,0.001,....,0.999,1.000) to a voltage .
Ex: if the angle=60 : sin(60)=0.8660254≈0.866 ===> 0.866V
thanks
I have an angle in the microcontroller from 0 to 360 , and I want to calculate its Sin , and display this number as analog .
I use CCS compiler , and I think that the Math library exists.
the hard thing how to convert the number from 0 to 1 ( if we neglige the negatif numbers ) , and with 3 digits after the point . (0.000,0.001,....,0.999,1.000) to a voltage .
Ex: if the angle=60 : sin(60)=0.8660254≈0.866 ===> 0.866V
thanks