(MCU AVR) ATmega32U4 (Arduino Micro) >> Arduino

LED


參考資訊:
1. cubie
2. arduino-cli

步驟如下:
1. 連接ATmega32U4板子到PC
2. 執行如下命令

$ cd
$ arduino-cli sketch new blink
$ vim blink/blink.ino
void setup() {
    pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
    digitalWrite(LED_BUILTIN, LOW);
    delay(1000);
}
$ arduino-cli compile --fqbn arduino:avr:micro blink
$ arduino-cli board list
    Port         Protocol Type              Board Name    FQBN              Core       
    /dev/ttyACM0 serial   Serial Port (USB) Arduino Micro arduino:avr:micro arduino:avr

$ arduino-cli upload --port /dev/ttyACM0 --fqbn arduino:avr:micro blink
    Connecting to programmer: .
    Found programmer: Id = "CATERIN"; type = S
        Software Version = 1.0; No Hardware Version given.
    Programmer supports auto addr increment.
    Programmer supports buffered memory access with buffersize=128 bytes.

    Programmer supports the following devices:
        Device code: 0x44

完成


返回上一頁