アプリ版:「スタンプのみでお礼する」機能のリリースについて

/* 自動□□装置           */
/* 2013年01月31日 MICR-V1      */
/* AVR TOOLS    AVR studio 4   */
/* マイコン型式    AT90S2323/2343   */

#include <avr/io.h>
#include <stdio.h>
int main (void)

long ka;
long ke;
long ke1;
long k10;
int kk;
int pa;
long tm1;
long tm2;
long tm3;
#define _PORT PORTB
#define _DDR DDRB
#define _PIN PINB

DDRB = 0xfe; /* 11111110 PB0;入力 PB1;出力 */
/* .c:23: error: expected declaration specifiers before '(' token */

if (!(PINB &_BV (PB0)) /*  PB0入力有り  */
/* .c:26: error: expected declaration specifiers before 'if' */


{
{tm2=0; tm1++; pa=tm1/100;}
if (pa>=10)
{
ka =12345; /* カルテNO ka=1~99999 */
ke = 0; /* 検索アドレス */
ke1 = 0; /* 桁検索アドレス */
k10 = 1; /* 桁x10 */
kk = 0; /* 桁カウンタ   */
pa = 0; /* 信号カウンタ */
tm1 = 0; /* 信号ONタイマ */
tm2 = 0; /* 信号OFFタイマ */
tm3 = 0; /* LED,ON-OFFタイマ */
else return 0;
else ((PINB &_BV (PB0)) /* PB0入力無し */
{
{tm1=0; tm2++;}
if {(tm2!=100) return 0;}
else (tm2==100)
if {(kk>=5) return 0; }
else if (kk<=4)
{
ke1 = pa*k10;
ke = ke+ke1;
k10 = k10*10;
kk ++;
pa = 0;
ke1 =0;
tm2 = 0;
}
if (kk!=5) return 0;
else if (kk==5)
if (ka !=ke) return 0;
}
else if (ka==ke)
do{
tm3=800;
do{
tm3--;
if (tm3>400) POBTB 0xff;
else if (tm3<400) PORTB 0xfe;
} while (tm3 !=0);
} while (tm3 ==0);

/* end of file */



/* 77: error: old-style parameter declarations in prototyped function definition
*/

/* Build failed with 3 errors and 0 warnings... *



上記のプログラムをBuildすると、エラーが23、26、77行に発生します、どう訂正すれば良いか具体的に教えてください。

A 回答 (2件)

int main (void)



のmain関数の始まりの{は何処にありますか?
    • good
    • 0

括弧の数が合っているか確認したほうが良いと思います。


よくあるミスですね。
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!