Teacup firmware M114 position reporting April 04, 2011 07:05PM |
Registered: 13 years ago Posts: 25 |
Re: Teacup firmware M114 position reporting April 04, 2011 11:37PM |
Registered: 16 years ago Posts: 1,094 |
printf("%d.%d", temp >> 2, (temp & 3) * 25)Adding floating point libraries would solve this handily, but also pushes up the size by a fair bit which seems excessive for a single output conversion.
p = pos; q = steps_per_mm; printf("%d.", p / q); p -= p / q; q /= 10; do { if (q == 0) q = 1; printf("%d", p / q); p -= p / q; q /= 10; } while p;
Re: Teacup firmware M114 position reporting April 05, 2011 04:15PM |
Registered: 13 years ago Posts: 25 |