Well, I would not call that simple, but a very interesting and useful link. Thank you!
Edmunds
Well, I would not call that simple, but a very interesting and useful link. Thank you!
I think you may be misunderstanding how to use twos complement maths. The sign is within the number, which means that the maximum range of values that can be handled is -32768 to +32767 (i.e. 15 bits + the sign bit) . It's rather confusing to refer to a signed number as 65532, rather better as $FFFC, where the PICaxe Editor is not "happy" with -4 (note it's not -3) . Hint: Subtracting 1 from zero gives $FFFF (or -1) , etc.but if you have 3 and 65532 (-3), then obviously, not only you need to remember the sign, but also the order of the actions (multiply and then divide or divide and then multiply) would have to be taken into account not to overflow the variable.
Alan, I agree about this thread and I'm partly to blame as I should have tried to keep it on the topic. However, I have been trying to split up the topics as for the benefit of the forum. I feel it will be easier for someone (maybe even myself) to find things in the future, if they are called 'dealing with signed numbers' or 'reading a miniature photo diode array' rather than all mixed up in a never-ending 'edmunds' project' thread. In the light of that, I'm starting a new thread to deal with signed numbers.This thread is getting very confusing with two different interleaved topics using different hardware from two "OP"s. Also the original OP does currently have rather a lot of different threads on the same (or a very similar) topic. :confused
Most likely I am, thus the cry for help. However it is not as bad as with the -3 vs -4 - that was just a typo .I think you may be misunderstanding how to use twos complement maths.
If someone can tell me which posts those are and suggest a title for the new thread I can do that.If a moderator could take the trouble to extract the posts on the second piece of hardware to another thread, it would be a blessing.