eddiewwm 发表于 2019-1-4 17:21:49

8F328P-U 不用Arduino上載 hex 檔

本帖最后由 eddiewwm 于 2020-3-7 19:08 编辑

步驟:
1) 把附檔解壓後放到 C: 盤,
2) 把要上載的hex檔更名為 upload.hex,放在 "LGT8F328Pblink_bootloader" 文件夾內(如已有同名文件,直接取代),
3) 執行 runCOM1.bat (使用com1 上載, 其餘 的是 com2, ....com10)


eddiewwm 发表于 2019-1-4 17:27:00

本帖最后由 eddiewwm 于 2020-3-7 19:07 编辑

:funk: 壓縮檔上傳不了!:funk:

【補回另一用小白盒配合使用的方法】


使用小白盒上傳,必需要先安裝好 libusbk-3.0.7.0-setup 驅動。詳細可參考:
http://wiki.ocrobot.com/doku.php?id=knowledge:application:2018042401




eddiewwm 发表于 2019-1-15 17:54:58

本帖最后由 eddiewwm 于 2019-4-1 15:02 编辑

使用 Processing範例

//How to upload an arduino sketch from java / processing?
// https://arduino.stackexchange.com/questions/3784/how-to-upload-an-arduino-sketch-from-java-processing

import java.io.*;

void setup(){
    String ArduinoPath = "C:\\Users\\User\\Desktop\\8F328U_Upload_Hex";
String hexPath = "C:\\Users\\User\\Desktop/8F328U_Upload_Hex/upload.hex";
    String port = "COM8";
    runCommand(new String[]{ArduinoPath+"/bin/avrdude", "-C"+ArduinoPath+"/avrdude.conf","-v","-patmega328p","-carduino","-PCOM8","-b57600","-D","-Uflash:w:"+hexPath+":i"});
}
void runCommand(String[] cmd){

    String s = null;

    try {

      Process p = Runtime.getRuntime().exec(cmd);
      BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
      BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));

      // read the output from the command
      System.out.println("command out:\n");
      while ( (s = stdInput.readLine ()) != null) System.out.println(s);
      System.out.println("errors (if any):\n");
      while ( (s = stdError.readLine ()) != null) System.out.println(s);

    }catch (IOException e) {
      System.out.println("something went wrong: \n");
      e.printStackTrace();
    }
}

void draw() {
//line(mouseX, mouseY, 50, 50);
delay(2000);
background(0);
text("Job Done!!!", 0, 20);
//exit();
text("Press mouse key to End", 0, 40);
}

void mousePressed() {
exit();
}

弘毅 发表于 2019-1-25 07:57:43

难道是这个版块没开附件权限?我去瞄瞄
页: [1]
查看完整版本: 8F328P-U 不用Arduino上載 hex 檔