My 'C' program is reading T1_CR0 from a SuperPro. I want to print the value read to the terminal. The code is:
TIMER_TABLE[k] = T1_CR0; //Read Timer1 Capture Register 0
printf("%ld\n", TIMER_TABLE[k]);
I use %ld to indicate that the value in TIMER_TABLE[k] is a long integer and I want a decimal value.
My terminal prints the character 'd'.
Printf with Long Integers
Re: Printf with Long Integers
It does print the long integer when the code is
'printf("%d\n", TIMER_TABLE[k]);'
It doesn't need the Long modifier. MakeitC does give me a warning however.
My real problem is that there are no counts in T1_CR0. I get the Capture Interrupt, but no counts. I have to look at the counter setup again.
'printf("%d\n", TIMER_TABLE[k]);'
It doesn't need the Long modifier. MakeitC does give me a warning however.
My real problem is that there are no counts in T1_CR0. I get the Capture Interrupt, but no counts. I have to look at the counter setup again.
Re: Printf with Long Integers
My T1 Timer was disabled. I set T1_TCR = 0. It should have been set T1_TCR = 1.
Now my printf statement produces a long decimal number.
Now my printf statement produces a long decimal number.