极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14469|回复: 3

8F328P-U 不用Arduino上載 hex 檔

[复制链接]
发表于 2019-1-4 17:21:49 | 显示全部楼层 |阅读模式
本帖最后由 eddiewwm 于 2020-3-7 19:08 编辑

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


回复

使用道具 举报

 楼主| 发表于 2019-1-4 17:27:00 | 显示全部楼层
本帖最后由 eddiewwm 于 2020-3-7 19:07 编辑

壓縮檔上傳不了!

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


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




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 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.co ... rom-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 | 显示全部楼层
难道是这个版块没开附件权限?我去瞄瞄
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-20 19:49 , Processed in 0.038498 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表