char is unsigned by default on ARM platform.
Yes, I just discovered that when testing my code.
I will post details shortly, I just want to check the RGB calculation results.
At least my spotmeter function is now returning negative values for U and V.
EDIT:
So, I have :-
int spotmeter[3];
and in a loop :
spotmeter[1]+=(signed char)img[(y*vp_w+x)*3];
and after 96 samples from centre of screen :
ubasic_set_variable(1,spotmeter[1]/96);
returns the result in variable 'b'.
The calculated RGB values (calculated 'externally' with uBasic) are then correct.