The result of sin and cos are twos complement. This is a bit hard to describe. Here it is displayed:

The sin and cos functions are made for byte variables. If you use word variables, it will throw your numbers WAY off, like you saw in the cos example you shared. You need to change those back to bytes. Other than that, it sounds like you got it, as you are converting degrees to "binary radians" correctly. (degrees * 255/360)
The results -127 to 127 represent -1 to 1. If you do sin of 270 degrees (270*255/360) = 191 ,sin of 191 would displays an answer of 129 on your LCD. That is actually -127 , or -1.
http://www.scalerobotics.com
Bookmarks