arduino rosserial with interrupt
Hi all,
I'm now building a robot which uses interrupt to count up the number of ticks and do the calculations in arduino nano, after that I decided to use rosserial library to send the number of ticks to the raspberry pi, when I put the code which send the number of ticks inside the void loop function it works, but if I but the code inside the interrupt handler I doesn't work very well and when it work it send strange numbers for example "6074229997415956480" number of ticks .
ISR(TIMER1_COMPA_vect){
RTicks_msg.data = EncoderR.GetTicks();
LTicks_msg.data = EncoderL.GetTicks();
RTicksPup.publish(&RTicks_msg);
LTicksPup.publish(<icks_msg);
nh.spinOnce();
}
any help ..?
thanks,