** çҹ繤Դ繢ͧ¹ͧ 觼ҹ繵ͧ繴令Ѻ
ҡ բʹ ;ͤ ԡ سѧ¹¤Ѻ ӡ䢢
١ͧ Ѻ
Ѻ˹ѡ
 

AVR Arduino ͹ ¹鹰ҹ

㹵͹Ǽٴ֧ͧ÷ͧ¹дټŢͧ÷ͧ 㹺ҵʹͧͧ觾鹰ҹ仡ѹѺ 㹡¹ Arduino 鹨ǹСͺ 2 ǹ ǹѺá˹ҵҧǹͧӧҹ ͡ѧ
void setup ()
{
}
ǹ繡á˹ҵҧ ˹㹡ҹ INPUT OUTPUT 觡á˹ǹС˹§ҹ
void setup()
{
pinMode(led1, OUTPUT);
}

Void loop ()
{
}

ǹǹ¹ӧҹ 㹡÷ӧҹẺǹٻ
void loop()
{
digitalWrite(led1,HIGH); )
delay(1000);
digitalWrite(led1,LOW); );
delay(1000);
}

觾鹰ҹ

á˹ ˹ҹ
㹡͡ҹ ͧâҹ Digital pin 13 С˹ҷ 13 ͹ int led1 13; ·
int 繪Դ
led1 繪͵ë繵ͧ˹͹ѧҧ Ҩ a b c
13 ͢ Digital pin 13 ͧ
ѧҷӡûСȵҨеͧ led1 觨᷹ digital pin 13 ʹ駡¹
pinMode (pin , mode)
pinMode (pin mode ) ˹ port Digital
pin Ţͧ Port ( int)
mode ÷ӧҹ ͡Ҩз˹ҷ INPUT OUTPUT

int led1 = 13;
void setup()
{
pinMode(led1, OUTPUT); // ˹ Digital pin 13 (led1) ˹ҷ OUTPUT
}

digitalWrite(pin , value)
digitalWrite(pin , value) ˹ʶҹ port HIGH LOW
pin Ţͧ Port
value ˹ HIGH (1) LOW (0)

int led1 = 13;
digitalWrite(led1, HIGH); // ˹ digital pin 13 觢͡ 1 HIGH
digitalWrite(led1, LOW); // ˹ digital pin 13 觢͡ 0 LOW

delay ( )
delay (ms); 㹡˹ǧ 觵Ţ ( ) ʴ
delay (1000) ;˹ǧ 1000 ms 1 Թҷ ͧ ҧùҹ

digitalWrite(led1, HIGH);
delay (1000) ; //зӡ˹ǧҨҡ觴ҹ 1 Թҷ 俵Դ 1 Թҷ

ѧ Code ҡͧ Arduino 㹵͹
int led1 = 13; // ˹ Digital pin 13 led1
void setup()
{
pinMode(led1, OUTPUT); // led1 ˹ҷ output
}
void loop()
{
digitalWrite(led1,HIGH); // 觢͡ҡ led1 HIGH (俵Դ)
delay(1000); // ˹ǧ 1000 Թҷ
digitalWrite(led1,LOW); ); // 觢͡ҡ led1 LOW (俴Ѻ)
delay(1000); // ˹ǧ 1000 Թҷ
}

з㨤㹡ҹҡ е͹¹㹡ҹ 4 觤
int led1 = 13; // ˹ ҵТҹ
pinMode(led1, OUTPUT); // ˹ҹ INPUT OUTPUT
digitalWrite(led1,HIGH); // ˹ 觢 HIGH LOW
delay(1000); // ˹㹡˹ǧ

ѧҨöӤ㹺任ءҧäçҹ鹰ҹ çҹǡѺ çҹǡѺ¹ҧ 㹺͹仨¹çҹẺѺ


¹ 31 .. 2554