匿名
未登录
登录
丢石头百科
搜索
查看“Micro:bit系列教程1:初识micro:bit”的源代码
来自丢石头百科
名字空间
页面
讨论
更多
更多
页面选项
查看
查看源代码
历史
←
Micro:bit系列教程1:初识micro:bit
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体">Micro:bit<span style="font-size: 12.0pt;line-height:150%;font-family:宋体">是什么?Micro:bit全称为BBC Micro:bit,是一款英国广播公司(BBC)推出的,用于青少年编程教育的ARM开发版,接下来,让我们一起认识Micro:bit,学习Micro:bit的基本使用。 <h1>1.基本介绍 </h1> <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体"> Micro:bit采用了基于ARM Cortex-M0的nRF51822处理器,集成蓝牙,2.4G无线功能,板载5×5 LED点阵、两个可编程按键、加速度计、三轴地磁和温度计等资源。引出了20+5pin的扩展接口,可轻松胜任各种编程相关的教学与开发场景,包括编写电子游戏、机器人控制、科学实验和可穿戴装置开发等;仅有信用卡一半大小(4cm×5cm),还可以把Micro:bit集成到诸多便携的项目中。 <h1>2.基本硬件参数 </h1> Micro:bit的基本硬件组成如下图所示: [[File:191640a49eg9l4l9jx0jnj.jpg]] 具体参数如下图所示: <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">nRF51822</b><b><span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">处理器</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level2 lfo1;tab-stops:list 72.0pt"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">16 MHz 32<span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">位 ARM Cortex-M0内核 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level2 lfo1;tab-stops:list 72.0pt"><span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">蓝牙4.0低功耗/2.4GHz RF无线 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level2 lfo1;tab-stops:list 72.0pt"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">16kB RAM </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level2 lfo1;tab-stops:list 72.0pt"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">256kB Flash </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">KL26Z</b><b><span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">单片机</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level2 lfo1;tab-stops:list 72.0pt"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">48 MHz ARM Cortex-M0+<span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">内核 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level2 lfo1;tab-stops:list 72.0pt"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">128 KB Flash </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">地磁传感器</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> - MAG3110<span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">,I2C,获取三轴地磁数据 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">加速度传感器</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> - MMA8652<span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">,I2C,获取三轴加速度数据 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">3V</b><b><span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">电源接口</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">复位按键</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">Micro USB</b><b><span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">接口</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> - <span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">可接入电脑烧写/仿真,串口通信 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">5x5 LED</b><b><span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">点阵</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> - <span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">可显示文字、图形等 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span style="font-size: 12.0pt;font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">按键A/B</b><span lang="EN-US" style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt"> - <span style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">可编程按键 </li> <li class="MsoNormal" style="color:black;mso-themecolor:text1;mso-margin-top-alt: auto;mso-margin-bottom-alt:auto;text-align:left;mso-pagination:widow-orphan; mso-list:l0 level1 lfo1;tab-stops:list 36.0pt"><b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family:Arial; mso-font-kerning:0pt">I/O</b><b><span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">扩展接口</b><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-bidi-font-family: Arial;mso-font-kerning:0pt"> - <span style="font-size:12.0pt; font-family:宋体;mso-bidi-font-family:Arial;mso-font-kerning:0pt">含SPI、UART、I2C、AD、PWM等接口 </li> 其中,nRF51822为主控芯片,KL26Z为USB接口芯片,IO扩展接口详情如下图所示: [[File:191641u50gx9ls95eldqxq.png]] <h1>3.开发环境 </h1> Micro:bit的主流开发环境有:采用JavaScript开发的如MakeCode,采用Python开发的如MU: <h2 style="background:white"><span lang="EN-US" style="font-size:12.0pt; line-height:173%;font-family:黑体;font-weight:normal;mso-bidi-font-weight:bold">3.1. <span lang="EN-US" style="font-size:12.0pt;line-height:173%;font-family: 黑体;mso-bidi-font-family:Arial;color:#333333;font-weight:normal">JavaScript Blocks Editor </h2> <span style="font-size:12.0pt; line-height:150%;font-family:宋体">可采用积木块或JavaScript开发Micro:bit,其IDE名称为MakeCode,有Web版和离线版两种。 <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体"> 其中Web版的链接为: <span style="font-size:12.0pt;line-height: 150%;font-family:宋体">https://makecode.microbit.org/ ,其界面如下图所示: [[File:191642a6j4ts62grtg1km6.png]] <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体"> 离线版截止2018年9月依然处于公测状态,并且,目前只支持Windows 10 操作系统,如有需要可前往Microsoft Store搜索“MakeCode for micro:bit”进行下载安装,其界面,开发流程基本和Web版一致。 <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体"> 推荐使用离线版本,离线版本具有如下优势: <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体">1.<span style="font-size:12.0pt; line-height:150%;font-family:宋体">不受网络限制。 <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体">2.<span style="font-size:12.0pt; line-height:150%;font-family:宋体">可以直接下载hex到micro:bit上面,不用每次将hex文件拷贝到micro:bit的U盘。 <span lang="EN-US" style="font-size: 12.0pt;line-height:150%;font-family:宋体">3.<span style="font-size:12.0pt; line-height:150%;font-family:宋体">内置串口调试工具,可观测串口打印的数据,本教程有较多演示部分使用了串口调试工具。 <h2 style="background:white"><span lang="EN-US" style="font-size:12.0pt; line-height:173%;font-family:黑体;font-weight:normal;mso-bidi-font-weight:bold">3.2. Python Editor </h2> <span style="font-size:12.0pt; line-height:150%;font-family:宋体">可采用Python开发Micro:bit,目前也有Web版和离线版两种开发环境。 <span style="font-size:12.0pt; line-height:150%;font-family:宋体">其中Web版下载地址为: <span style="font-size: 12.0pt;line-height:150%;font-family:宋体">https://python.microbit.org/v/1 ,其界面如下图所示: [[File:191643ophhbfbqqbppofeh.png]] <p align="left" class="MsoNormal" style="text-align:left;text-indent:21.0pt; line-height:150%"><span style="font-size:12.0pt;line-height:150%;font-family: 宋体">离线版为Mu,其下载地址为: <span style="font-size:12.0pt; line-height:150%;font-family:宋体">https://codewith.mu/en/download ,可根据不同的操作系统以及位数进行下载,安装,其开发界面如下图所示: [[File:191644xqul478683wwoxux.png]] <span style="font-size:12.0pt; line-height:150%;font-family:宋体">初次进入,请设置为BBC Micro:bit模式: [[File:191644iixookmlqtk0za60.png]] 下载程序时,离线版本更加便捷,只需点击下载,程序将直接下载到Micro:bit:如下图所示: [[File:191645ml8ccc2rc8c2orca.png]] [[File:191646zt9qwqrdqzp5wy8q.png]] <span style="font-size:12.0pt; font-family:宋体">此时,可通过Mu对Micro:bit进行串口调试,如下图所示: [[File:191646z7zgacauapgjegr6.png]] <span style="font-size:12.0pt; font-family:宋体">如果为Web版本,则点击下载之后将会把HEX文件下载到本地文件夹,之后需把HEX文件拷贝至Micro:bit所对应的盘符中,Web版本MakeCode和Web版本Python开发环境操作相同,如下图所示: [[File:191647n747bn9vc5ec0ofu.png]]
返回至
Micro:bit系列教程1:初识micro:bit
。
导航
导航
首页
最近更改
随机页面
MediaWiki帮助
首页
首页
树莓派
主机
配件包
外壳
键鼠
电源
扩展板
显示屏
墨水屏
摄像模块
通信模块
继电器
电机驱动板
游戏机
产品分类
树莓派
Arduino
micro:bit
STM32
Espressif
WiFi模块
蓝牙模块
无线模块
LoRa模块
4G模块
GSM
GPRS
以太网
导航模块
北斗卫星
GPS
LCD
墨水屏
OLED
摄像头
USB模块
串口模块
RS232
RS485
CAN
传感器
温度模块
湿度模块
气压模块
继电器
电机模块
指纹模块
电平转换
音频模块
编程器
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志