I didn't work with raspberry pi and embedded
python, but I suspect that
angles should be given in radians; in this case my code should be changed, e.g. 360 must be replaced with, e.g. 3.1415 * 2.
python, but I suspect that
PIN_DAT = [3,14]
should be PIN_DAT = [3.14]
, if 3,14
stands for pi
here...?! def deg2count(angle, maxcount=1023): """ 0 <= angle <= 360 """ return int(angle / 360.0 * maxcount) def count2deg(count, maxcount=1023): return int(count / maxcount * 360)Since your code includes series of numbers 3,1,4 (pi approx 3.14), I suspect that
angles should be given in radians; in this case my code should be changed, e.g. 360 must be replaced with, e.g. 3.1415 * 2.