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

AVR Arduino ͹ ÷ͧ

㹵͹Ǽ¹йӡ Arduino ѹ㹺͹Ƕ֧¹ѹǤѺ ͹зӡ¹Ҩѡ IC 㹡ѹ͹Ѻ ˹觢
㹵͹ҷӤѡѺҹТҡѹ͹


á˹˹觢㹡ҹ


Atmega 168 / 328 鹨յǶѧе˹觢ҷ͹ѹ IC Atmega 168/328 鹨 PORT ҹ 3 PORT PORT B , PORT C PORT D PORT кتԴͧҹѧٻѧ VCC 繢Ѻ§ IC дѺçѹ 5VDC GND 繵˹觢 ź Reset 繢Ѻ Crystal 繢Ѻõ crystal Ѻҧ Digital pin 繢Ѻ I/O Ẻ Digital Analog 繢ѺѭҳẺ ͹͡

㹷Ẻ Digital ѹѺ ¢Ңͧ Digital մ¡ѹ 14 Digital pin 0 ֧ Digital pin 13 ѧ㹡á˹˹觢㹡¹еͧ˹ digital pin Ѻ ͧ仡˹ Ẻ PORT ͹ ä͹Ẻ

¹
㹵͹Դ Arduino ǡ˹ͧҹ code º Ѻ촷ͧ鹨 LED Ѻͺ÷ӧҹ LED е͡Ѻ Digital pin 13 Ѻ ѧ鹡¹ҨҴѧ㹡÷ͺ


õǧ㹺ͷͺ¹


ӡ¹ѧ仹
int led1 = 13;
void setup()
{
pinMode(led1, OUTPUT);
}
void loop()
{
digitalWrite(led1,HIGH);
delay(1000);
digitalWrite(led1,LOW);
delay(1000);
}


¹


ҡѡԹöѺҴ价 File > Preferences 任ѺҴ㹪ͧ Editor font size


ûѺҴѡ

ҡ compile Sketch > Verify / Compile ͡ٻ١÷ҹش ѧٻ


ä


ͤ˹ ͧõԴ͡ѺС˹ҹ١ͧ¤Ѻ


á˹ҹ (繵ͧ͹Ѻٻ)



á˹ port ҹ


ͷӡä 辺ͼԴҴ ӡ upload Code ŧ㹵 IC ѧٻ


Upload


ҡټš÷ͧ俨СоԺԴѺѺѹ价ء 1 Թҷ

͸Ժ
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 Թҷ
}

㹺͹仨Ƕ֧ ѡ¹ ҹ觾鹰ҹӤѭѺ


¹ 30 .. 2554