hi C,
I wrote the CASE version for the old GPS program.
We needed a ASCII STRING to write to the 5110 LCD and a SINGLE value for the MATHS routines.
The PROC version I wrote for the Servo's program
The Tmr1 requires the loaded Count Up value in Binary.
So the routine extract each ASCII STRING value from the Base msg converts the extract into a WORD, then the WORD is subtracted from 65535 [0xFFFF] to give the Tmr1 count up load value.
BTW: instead of subtracting you can use, value= NOT value, to give the Tmr1 load value.
There is no best way, the routines were written for different modules.
E
I wrote the CASE version for the old GPS program.
We needed a ASCII STRING to write to the 5110 LCD and a SINGLE value for the MATHS routines.
The PROC version I wrote for the Servo's program
The Tmr1 requires the loaded Count Up value in Binary.
So the routine extract each ASCII STRING value from the Base msg converts the extract into a WORD, then the WORD is subtracted from 65535 [0xFFFF] to give the Tmr1 count up load value.
BTW: instead of subtracting you can use, value= NOT value, to give the Tmr1 load value.
There is no best way, the routines were written for different modules.
E
