i seen to be having a problem with the line:
int xPos = ((x / maxX) * X_AXIS_LENGTH) + X_AXIS_OFFSET; =
for testing purposes i have assigned:
int x = 10;
int maxX = 52;
but when used in this calculation x / maxX gives me 0 instead of 0.19!
You’re doing integer division here:
Integer division will truncate the fractional part.
Cast one of the parameters to floating-point to fix it:
You might also want to store the whole thing into a
doubleinstead ofint: