Closed hardyjosh closed 8 years ago
The only thing I can think of is that your board/compiler is not using 32 bit integers. The DrawLine uses fixed point 32 bit integers to handle the fractional step portion from 1 pixel to the next when drawing lines. All my test code is compiled and run on Teensy's which handle 32bit fine, I don't have access to any 16bit micros to test this out.
This is correct that the Arduino Mega for example can not handle 32bit integers. I have the same problem with drawline
EDIT:
Actually, having played some more, I'm not sure that the int32_t is the problem?
EDIT 2: I Lie, apparently the Arduino Mega for example is only an 8-bit but can use 16 bit register
Finally found out the cause of this issue :) It's the way the Arduino compiler handles promotion from 16 to 32 bits! If you want a fixed version please check out https://github.com/AaronLiddiment/LEDMatrix As I'm not updating this combined repository anymore.
Hey Aaron
Firstly, thanks for the classes. Super useful! Also your Tetris is freaking awesome.
I'm struggling to get DrawLine to do what I'd expect, even when using your example code. No matter what values I put in as x0, y0, x1, y1, my line is either vertical on x=0 or horizontal on y=0. DrawCircle is working perfectly, as are the mirror functions.
Example
gives me:
Am I doing something obviously wrong here?
Thanks!