Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ICR1=2499; //using F_cpu =8 mhz
- while(!(UCSRA &(1<<RXC)));
- return UDR;
- //++++++++++++Yaw+++++++++++++++++++++++++++++++++++
- {value=uart_receive();
- if (value==',')
- {
- for(i=0;i<8;i++){
- yaw[i]= uart_receive();}
- yaw_angel=atof(yaw);//convert string to double
- PORTC=0x01;
- dtostrf(yaw_angel,8,3,yaw);//convert double to string
- //++++++++++++Pitch+++++++++++++++++++++++++++++++++++
- value=uart_receive();
- if (value==',')
- {
- for(i=0;i<8;i++){
- pitch[i]= uart_receive();}
- pitch_angel=atof(pitch);//convert string to double
- dtostrf(pitch_angel,8,3,pitch);//convert double to string
- //++++++++++++Roll+++++++++++++++++++++++++++++++++++
- value=uart_receive();
- if (value==',')
- {
- for(i=0;i<8;i++){
- roll[i]= uart_receive();}
- roll_angel=atof(roll);//convert string to double
- dtostrf(roll_angel,8,3,roll);//convert double to string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement