betuse
Junior Member level 3
- Joined
- Oct 17, 2013
- Messages
- 26
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 173
Hi for all,
I need to send int array via UART to PC,
I use PIC16F887,
the code for creating array is:
(exactly I count impulses every 1ms from encoder with Timer1...)
can sombody advice how to do that?
best regards
I need to send int array via UART to PC,
I use PIC16F887,
the code for creating array is:
(exactly I count impulses every 1ms from encoder with Timer1...)
Code:
unsigned int TMR1_value;
int vector[48];
char i = 0;
void main() {
ANSEL = 0;
ANSELH = 0;
OSCCON = 0b01110001;
T1CON = 0b00000111;
TRISC = 1;
TRISA = 0;
PORTA = 0b00000001;
TMR1H = TMR1L = 0;
while(1) {
TMR1_value = (TMR1H << 8) + TMR1L;
vector[i] = TMR1_value;
i++;
delay_ms(1);
if (i == 48) break;
}
}
best regards