Practice more and More

void reverse(unsigned char data)
{
 unsigned char tmp=0;


 
 // 데이터 뒤집어 주는 부분.
 for(char i=0; i<8;i++)
 {

  tmp|=(data&0x01)<<(7-i);        // 0x01 비트 부터 비교해서 넣어줌.
 
  data>>=1;                            // 데이터를 옮겨서 다음비트 비교할 수 있도록 해줌.
 
 } 
 

 
 data = tmp;
}

#warning "F_CPU not defined for <util/delay.h>" [Wcpp]

 

이때

 

메뉴에서 Project- Configuration option 에서

 

 

 

 

 

 

avr 클럭을 넣어주면 오류 사라짐.

(16Mhz라서 16000000을 넣어주었음.)