【Arduino】LGT8F328 UNO R3编译上传

LGT8F328 UNO R3编译上传

示例代码

这是一段示例代码,将示例代码编译打包上传到LGT8F328 UNO R3开发板。

#include <Servo.h>
Servo myservo;
int pos = 0;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("start");

  myservo.attach(11,500,2500);
}

void loop() {
  // put your main code here, to run repeatedly:
  for(pos = 0;pos<=180;pos+=5){
    myservo.write(pos);
    Serial.println(pos);
    delay(22);
  }
  for(pos = 180;pos>=0;pos-=5){
    myservo.write(pos);
    Serial.println(pos);
    delay(22);
  }
}

添加开发板

首先要添加一个开发板,在arduino ide的菜单》文件》首选项》其他开发板地址,添加:http://cdn.vue-os.com/package_nulllab_boards_index_zh.json
这是源仓库的配置,我搬运了一个到我的服务器上。
我这克隆的仓库地址:https://gitee.com/piaoyizhe666666/nulllab_arduino.git
仓库源地址:https://github.com/nulllaborg/arduino_nulllab.git

编译上传

上传配置:
开发板=》DIY Board
CPU Frequency=》16 MHz
Clock Source=》Internal (32MHz)
EEROM Size=》OKB
Upload speed=》57600
Variant=》LGT328P-LQFP48
编程器=》Arduino/Nulllab as ISP(LGT8F328P)

我这样顺利上传了,不用完全一样,有些项可以按情况修改。

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值