full duplex serial communication with a laptop using ATMEGA8 USART
Your question doesn't really fit the guidelines, I don't think...

Here's some pseudo code, implementation is left to the student:

if got 's', do loop

loop{
send_accel_data();
check_for_char(t);
if 't', break
}


It's easier if you have the sending and receiving interrupt driven, if your project is more complicated.