Steward
分享是一種喜悅、更是一種幸福
微處理器 - Microchip ATmega328 (Arduino Nano) - Arduino - LED
參考資訊:
https://swf.com.tw/?p=1840
https://github.com/arduino/arduino-cli/issues/538
https://arduino.github.io/arduino-cli/0.31/installation/
步驟如下:
1. 連接板子到PC
2. 執行如下命令
$ cd $ arduino-cli sketch new blink $ vim blink/blink.ino
1 2 3 4 5 6 7 8 9 10 | 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:nano:cpu=atmega328old blink $ arduino-cli board list Port Protocol Type Board Name FQBN Core /dev/ttyUSB0 serial Serial Port (USB) Unknown $ arduino-cli upload -v -p /dev/ttyUSB0 -b arduino:avr:nano:cpu=atmega328old blink avrdude: 924 bytes of flash written
完成