Oshonsoft programs with INTERRUPTS and PARSE

djsfantasi

Joined Apr 11, 2010
9,163
Note that in sagor’s reply, if A[ ] has a dimension of 10, it’s last element is A[9]. This can be confusing. Remember that when an array is used, it’s indices always start at 0. Thus, for n (eg 10) elements, the last element will always be n-1 (eg 9). Also remember that the first element will always be A[0].
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
The variable "A" is the name of the array of bytes, addressable as A(0) to A(9) (10 bytes)
Hi S and D,
Ok, thanks. it makes sense.

I got a 'realisation' !!
The first thing I'm trying to do is send 0 to 359 Degrees from and incremental encoder on an 18F4431. In my 1st post, I ask about adding zeros in front of some data so that there are always 3x digits, keeping the DATA the same length, for parsing, e,g, 001 020, 359.
This is because I use an 18F4431 QEI to output 0 to 359 (after calculation) to the MAIN PIC for use.

Remembering that the QEI outputs 2x BYTEs. I now think, why not send the 2x BYTEs to the MAIN PIC and then do the 0-359 calculation. e,g, DIM QEIDEG(2) as BYTE.

Does this sound good?
C
 
Last edited:
Top