Digispark控制板使用
從 YFRobotwiki
目錄
[隱藏]連接並使用digispark
Bootloader:
The bootloader is the code that is pre-programmed on your Digispark and allows it to act as a USB device so that it can be programmed by the Arduino IDE.
The Digispark runs the 「micronucleus tiny85」 bootloader version 1.02, an open source project: https://github.com/micronucleus/micronucleus originally written by Bluebie: https://github.com/Bluebie.
CAUTION We are not at this point supporting upgrading the firmware, so if you decide to, you do so entirely at your own risk.
Software:
The Digispark uses the Arduino IDE 1.6.5+ (Arduino 1.6.5r2 - NOT 1.6.6 or 1.6.7 strongly recommended)
安裝說明
windows install
- 首先下載arduino IDE :http://www.arduino.cc/en/Main/Software (1.6.5以上版本)
- 雙擊運行arduino IDE, file -> preferences
- 在 Additional Boards Manager URLs 輸入框中填寫:http://digistump.com/package_digistump_index.json,點擊OK
- Tools -> Boad -> Boards Manager,type選擇 "Contributed",之後選擇"Digistump AVR Boards" 安裝包,點擊"Install"按鈕進行安裝
- 等待下載安裝完成後,會顯示"Installed";完成後,Tools -> Boards ->Digispark(Default - 16.5mhz),新用戶建議選擇該項。
- 安裝完成
Linux Install
- If you haven't before - Install the udev rules found here:Troubleshooting section
下載程序測試
digispark 和其他arduino兼容產品不同,下面看看具體哪裡不同?
- 板型選擇:Tools -> Boards -> Digispark(Default - 16.5mhz) (Tools -> Programmer無需選擇)
- 打開例程代碼:File -> Examples -> Digispark_Examples -> Start (無需連接控制板),代碼如下:
// the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(0, OUTPUT); //LED on Model B pinMode(1, OUTPUT); //LED on Model A } // the loop routine runs over and over again forever: void loop() { digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(1, HIGH); delay(1000); // wait for a second digitalWrite(0, LOW); // turn the LED off by making the voltage LOW digitalWrite(1, LOW); delay(1000); // wait for a second }
- 點擊"Upload"按鈕,底部狀態欄會提示要求連接digispark控制板,這時你需要將其插入(你有60s的時間將其連接上,不用着急)
- 插上Digispark控制板後,等待下載完成,底部狀態欄會有提示,如下圖:
- 程序下載完成後,它將立即運行代碼
PS:如果你拔掉digispark並重新供電,程序將延時5秒運行。這5秒延時是確定你是否想要運行此程序。
更多建議和問題歡迎反饋至 YFRobot論壇
購買方式:YFRobot 電子工作室