今天買了張arduino UNO MEGA328P ATMEGA16U2 R3版來玩,因為這張卡比較新,所以要用unstable中的arduino才找的到這張卡。
安裝很簡單,只要打
apt-get -t unstable install arduino
幾分鐘後,一切搞定。
執行arduino後,開啟File->Examples->Basics->Blink
,改變led閃爍的速度。
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(3000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}
插上led,將卡接上usb,在tools下設好board及serial port,按verify後上傳,led馬上改成閃3秒休1秒了。
