septillion-git / tlc5940arduino

Automatically exported from code.google.com/p/tlc5940arduino
0 stars 0 forks source link

Error while using tlc_servos.h #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
If you set the maximum angle value in tlc_servox.h greater than 255, the 
behaviour of the package is wrong, due to an overflow problem.
All the functions in tlc_servoc.h erroneously use uint8_t instead of uint16_t. 

What is the expected output? What do you see instead?
If you set SERVO_MAX_ANGLE greater than 255, you get a wrong behaviour. 
Overflow.

What version of the product are you using? On what operating system?
Trunk version from svn.

Please provide any additional information below.
All the functions in tlc_servos.h have to be changed from uint8_t 
to unit16_t. 
The functions in Tlc5940.h and cpp are correct and the input and 
return values are uint16_t, but the tlc_servos.h calls those functions passing 
a uint8_t (trunked version) value instead of a uint16_t.

Original issue reported on code.google.com by lte...@gmail.com on 28 Aug 2012 at 7:02