建筑兔零基础Arduino自学记录47|安装和实战小灯闪烁-1

一、安装Arduino

arduino阿丢伊诺官网Arduino - Home

​ 

 安装完毕

 二、安装Mixly米思齐

软件平台 - Let's Mixly!

 

三、注册Tinkercad

这是在没有实体开发板的时候一个替代,免费网站。点击创建电路,即可开始一个项目。

Tinkercad  官网在这
    补充以上一二三步均为基础环境布置。1为官方平台,2为国内自行开发平台,用于图示化编程,3为结合1和2同时解决手边没有实体板的问题。


四、实战Tinkercad——让板子上的灯闪烁

将选取的元件拖入工作区域, 选择喜欢的编辑模式

 我这是是直接把亮灯的样例代码复制进去,点击开始模拟可以看到灯在闪烁

样例代码如下:

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}

也可以选用这样图示化的编程方式,直接拖拽更改部分内容就可模拟。

附:实物配件

如果用Mixly来编写的话,步骤:

之前我选过python但是控制部分只有打印没有需要的管脚,所以更改为Arduino AVR

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值