BASIC4MCU | 질문게시판 | avr 스톱워치 코드 오류가 뜨는데 이유를 모르겠습니다ㅜㅜ
페이지 정보
작성자 아르기닌 작성일2022-12-14 22:47 조회315회 댓글1건본문
PINE이 포함된 라인이 전부
expected ')' before numeric constant라는 오류가 뜨네요ㅜㅜ
#include<avr/io.h>
#define F_CPU 16000000UL
#include<util/delay.h>
const unsigned char FND_DATA[]= {0x3f,
0x06, 0x5b, 0x4f, 0x66, 0x6d,
0x7d, 0x27, 0x7f, 0x6f };
int main(){
int j=0;
int i=0;
int count=0;
int count2=0;
int sw1=0;
int count_min=0;
int count2_min=0;
int Start=0;
int Reset=0;
if(Start==1)
{
for(j=0 ; j<8 ; j++ )
{
PORTC = FND_DATA[count_min];
PORTG = 0x08;
_delay_ms(i);
_delay_us(136);
PORTC = FND_DATA[count/100];
PORTG = 0x04;
_delay_ms(i);
_delay_us(136);
if ( count%10<5 ) {
PORTC = FND_DATA[(count/10)%10]|0x80;
}
else
PORTC = FND_DATA[(count/10)%10];
PORTG = 0x02;
_delay_ms(i);
_delay_us(136);
PORTC = FND_DATA[count%10];
PORTG = 0x01;
_delay_ms(i);
}
}
if ( count%10<5 )
PORTC = FND_DATA[(count/10)%10]|0x80;
else
PORTC = FND_DATA[(count/10)%10];
if(sw1==0 && PINE.4==1 )
sw1=1;
if(sw1==1 && PINE.4==0 )
{
sw1=0;
if( Start==1 ){
Start=0;
count2=count;
count2_min=count_min;
}
else{
Start=1;
}
}
if( PINE.5==0 )
Reset=1;
else
Reset=0;
if( count==0 && Start==0 ) {
}
else
count++;
if( Start==0 && Reset==1 ) {
count=0;
count_min = 0;
count2=0;
count2_min=0;
}
}
감사합니다
댓글 1
조회수 315master님의 댓글
master 작성일
PINE.4
PINE.5
이런 표현은 코드비젼만 가능합니다.
AVRstudio는 비트마스크 방법으로 변환해야 합니다.
//
if(sw1==0 && PINE&0x10 ) // if(sw1==0 && PINE.4==1 )
if(sw1==1 && PINE&0x10==0 ) // if(sw1==1 && PINE.4==0 )
if( PINE&0x20==0 ) // if( PINE.5==0 )