├── 1 ├── 1-0.md ├── 1-1 │ ├── 1-1-0.md │ ├── 1-1-1.md │ └── 1-1-2.md ├── 1-2 │ ├── 1-2-0.md │ ├── 1-2-1.md │ └── 1-2-2.md └── 1-4 │ ├── intro.md │ └── producer.md ├── 2 ├── 2-0.md ├── 2-1.md └── 2-2.md ├── .gitigore ├── README.md ├── SUMMARY.md ├── _book ├── 1 │ ├── 1-0.html │ ├── 1-1 │ │ ├── 1-1-0.html │ │ ├── 1-1-1.html │ │ └── 1-1-2.html │ ├── 1-2 │ │ ├── 1-2-0.html │ │ ├── 1-2-1.html │ │ └── 1-2-2.html │ └── 1-4 │ │ ├── intro.md │ │ └── producer.md ├── 2 │ ├── 2-0.html │ ├── 2-1.html │ └── 2-2.html ├── .gitigore ├── gitbook │ ├── app.js │ ├── fonts │ │ └── fontawesome │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ ├── images │ │ ├── apple-touch-icon-precomposed-152.png │ │ └── favicon.ico │ ├── plugins │ │ ├── gitbook-plugin-fontsettings │ │ │ ├── buttons.js │ │ │ └── website.css │ │ ├── gitbook-plugin-highlight │ │ │ ├── ebook.css │ │ │ └── website.css │ │ ├── gitbook-plugin-search │ │ │ ├── lunr.min.js │ │ │ ├── search.css │ │ │ └── search.js │ │ └── gitbook-plugin-sharing │ │ │ └── buttons.js │ └── style.css ├── imgs │ ├── 1.1.1-1.png │ ├── 1.1.1-2.png │ ├── 1.1.1-3.png │ ├── 1.1.1-4.png │ ├── 1.1.1-5.png │ ├── 1.1.1-6.png │ ├── 1.1.1-7.png │ ├── 1.1.1-8.png │ ├── 1.1.2-0.png │ ├── 1.1.2-1.png │ ├── 1.1.2-2.png │ ├── 1.1.2-3.png │ ├── 1.1.2-4.png │ ├── 1.1.2-5.png │ ├── 1.1.2-6.png │ ├── 1.1.2-7.png │ ├── 1.2-1.jpg │ ├── 1.2-10.jpg │ ├── 1.2-11.png │ ├── 1.2-12.png │ ├── 1.2-13.png │ ├── 1.2-2.jpg │ ├── 1.2-3.jpg │ ├── 1.2-4.jpg │ ├── 1.2-5.jpg │ ├── 1.2-6.jpg │ ├── 1.2-7.jpg │ ├── 1.2-8.jpg │ ├── 1.2-9.jpg │ ├── 1.2.1-1.png │ ├── 1.2.1-2.jpg │ ├── 1.2.1-3.png │ ├── 1.2.1-4.png │ ├── 1.2.1-5.png │ ├── 1.2.1-6.png │ ├── 1.2.1-7.png │ ├── 1.2.1-8.png │ ├── 1.2.2-1.png │ ├── 1.2.2-2.png │ ├── 1.2.2-3.png │ ├── 1.2.2-4.png │ ├── 2.1-1.png │ ├── 2.1-2.png │ ├── 2.1-3.png │ ├── 2.1-4.png │ ├── 2.1-5.png │ ├── 2.2-1.jpg │ ├── Pi3-differences_700.jpg │ ├── Pi3B-underside_700.jpg │ ├── README.md │ ├── SUMMARY.md │ ├── gpio.png │ ├── osc.png │ ├── pwm.png │ ├── rasp0.png │ ├── rasp1.png │ ├── sd.png │ ├── sysPower.png │ └── usbPower.png ├── index.html └── search_index.json └── imgs ├── 1.1.1-1.png ├── 1.1.1-2.png ├── 1.1.1-3.png ├── 1.1.1-4.png ├── 1.1.1-5.png ├── 1.1.1-6.png ├── 1.1.1-7.png ├── 1.1.1-8.png ├── 1.1.2-0.png ├── 1.1.2-1.png ├── 1.1.2-2.png ├── 1.1.2-3.png ├── 1.1.2-4.png ├── 1.1.2-5.png ├── 1.1.2-6.png ├── 1.1.2-7.png ├── 1.2-1.jpg ├── 1.2-10.jpg ├── 1.2-11.png ├── 1.2-12.png ├── 1.2-13.png ├── 1.2-2.jpg ├── 1.2-3.jpg ├── 1.2-4.jpg ├── 1.2-5.jpg ├── 1.2-6.jpg ├── 1.2-7.jpg ├── 1.2-8.jpg ├── 1.2-9.jpg ├── 1.2.1-1.png ├── 1.2.1-2.jpg ├── 1.2.1-3.png ├── 1.2.1-4.png ├── 1.2.1-5.png ├── 1.2.1-6.png ├── 1.2.1-7.png ├── 1.2.1-8.png ├── 1.2.2-1.png ├── 1.2.2-2.png ├── 1.2.2-3.png ├── 1.2.2-4.png ├── 2.1-1.png ├── 2.1-2.png ├── 2.1-3.png ├── 2.1-4.png ├── 2.1-5.png ├── 2.2-1.jpg ├── Pi3-differences_700.jpg ├── Pi3B-underside_700.jpg ├── README.md ├── SUMMARY.md ├── gpio.png ├── osc.png ├── pwm.png ├── rasp0.png ├── rasp1.png ├── sd.png ├── sysPower.png └── usbPower.png /.gitigore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store* 3 | Icon? 4 | ._* 5 | 6 | # Windows 7 | Thumbs.db 8 | ehthumbs.db 9 | Desktop.ini 10 | 11 | # Linux 12 | directory 13 | *~ 14 | -------------------------------------------------------------------------------- /1/1-0.md: -------------------------------------------------------------------------------- 1 | # 微控制器 2 | 微控制器也叫MCU(Microcontroller Unit)。微控器种类繁多,有很多种维度进行区分。比如:架构,功耗,封装。本章主页介绍目前市面比较流行的两款开源硬件,树莓派以及arduino. 3 | ## TODO 4 | -------------------------------------------------------------------------------- /1/1-1/1-1-0.md: -------------------------------------------------------------------------------- 1 | # 树莓派 2 | ## 树莓派简介 3 | Raspberry Pi,中文名:树莓派。树莓派由注册于英国的慈善组织“Raspberry Pi 基金会”开发,旨在于学生计算机编程教育,树莓派官方的关键词就是:"Teach, Learn, and Make with Raspberry Pi"。在2006年,树莓派早期概念是基于[Atmel](http://www.atmel.com/)(Atmel公司会在单片机一章中有介绍)的 ATmega644单片机。2012年2月29日,树莓派基金会发布了256MB内存的树莓派B型。四年后,也就是2016年2月29号,基金会宣布树莓派3 B型将以35美元的价格发售。 4 | ## 树莓参数对比 5 | 与前三款比较(包括树莓派 B+),树莓派3在硬件配置上有什么不一样呢? 6 | 以下是主要几款树莓派(不包括树莓派A+及Zero)的主要参数对比: 7 | 8 | | 硬件 | A型 (一代) | B型 (二代) | B+版 | 树莓派3 B型 | 9 | | ------------- |------------- | -------------|----------| ----------| 10 | | CPU | ARM1176JZF-S核心(ARM11系列)700MHz | 900MHz的四核 Cortex-A7 | 同左 | 1.2GHz 四核 64 位 ARMv8 处理器| 11 | | SoC(系统级芯片 )| Broadcom BCM2835| Broadcom BCM2835 | 同左 | Broadcom BCM2837 | 12 | | GPU(图形处理器)| Broadcom VideoCore IV, OpenGL ES 2.0, 1080p 30 h.264/MPEG-4 AVC 高清解码器 | 同左 | 同左 | 同左 | 13 | | 内存 | 256MB | 512MB | 512MB | 1GB | 14 | 15 | 据说,树莓派3外观相对前几款树莓派并没有太多变化,但性能提升了50%。而且,就在树莓派3发布几天之后,windows 10 iot就提供了支持对树莓派3的支持,可以看出大家对这款卡片机的青睐。于是,我特意查了一下BCM2835以及BCM2837这两款系统级芯片,但里面主要介绍了树莓的外围扩展,定时器,中断,GPIO,PWM等,有更高的项目需求可以看看。如果想看具体的芯片书册,可到datasheet进行下载,附上[BCM2835链接。](http://www.alldatasheet.com/datasheet-pdf/pdf/502533/BOARDCOM/BCM2835.html) 16 | 17 | -------------------------------------------------------------------------------- /1/1-1/1-1-1.md: -------------------------------------------------------------------------------- 1 | # 树莓派硬件系统 2 | 在上一章节中,简单的介绍了树莓派及各版本树莓派参数的对比。这一章节会重点介绍树莓派的硬件系统(树莓派的 CPU 架构将会在 AMR 章节中讲述)。首先,我们会直接介绍树莓派的原理图。然后在拿一款真实的树莓派,简单的看看在电路图中的各组成部分。 3 | 4 | ## 供电系统及振荡电路 5 | ![系统芯片的电源及接地](../../imgs/1.1.1-1.png) 6 | 7 | 上面这个看起来很复杂的几个电路,其实只做了一件事,就是给系统芯片(BCM2835)供电。可以看到所有管脚只连接到了 VCC(5v、3.3v、1.8v)和 GND。其中一些管脚还需要做些限流,限压等,接了一些电容,电阻及电感等。然而硬件工程师并不需要自己去计算这些元件的参数,因为芯片厂商在设计每款芯片时,都会设计这些外围电路,并在芯片手册中附上最佳电路图。而使用这些芯片的硬件工程师只需要画 PCB 版的时候设计如何布局及连线。 8 | 9 | ![usb及转压芯片](../../imgs/1.1.1-2.png) 10 | 11 | 上图左边的是usb供电电路,右边是转压电路,这两个电路在所有的硬件设计中都是比较简单和常用的电路。左边图中2、3、4三个关键是 usb 的数据及主从控制管脚,一般 usb 都有是四个或五个管脚(其中两个为电源和地,另外两个为数据读写,还有一个可以作为主从控制,复杂的 usb 集群通信可以用到)。这里没有画出它们的连接。右边图主要用了 NCP1117-3v3、LP2980-2v5、NCP117-1v8 三款芯片将5v分别转化成3.3v,2.5v及1.8v。从在上一张图中可以看出,系统芯片出来需要5v,还分别需要1.8v及3.3v(很多芯片都是5v或3.3v供电),单从上一张图中并没有看出为什么会转一个2.5v的电压出来。 12 | 13 | ![振荡器](../../imgs/1.1.1-3.png) 14 | 15 | 上面的这个看似不起眼的电路其实就是整个系统的心脏,可以看到途中有 osc 的字母,osc 是英文字母 oscillator (振荡器)的缩写,MCU (微控制器)中通常对应的为晶振。振荡器主要作用是将直流电能转换为具有一定频率的交流电能的一种装置。而晶振的作用也就是将直流转化成频率,因为 MCU 工作时,是一条一条地从 ROM 中取指令,然后一步一步地执行。单片机访问一次存储器的时间,称之为一个机器周期,这是一个时间基准。一个机器周期包括12个时钟周期,而晶振就是提供这个时间基准。我们通常可以由所选的晶振频率计算出一个机器周期的时间,对应到汇编语言语言中,大概就能估算到一段代码的执行时间。图中的 19.2MHZ,那么一个时钟周期就是 12/19.2(0.625)微秒。这里也可以理解为什么不选用 19MHZ的晶振频率了,因为选用 19MHZ 作为晶振频率时,将会得到一个无限不循环小数的时钟周期,不利与计算。 16 | 17 | ## PWM及DAC 18 | 19 | ![PWM及DAC电路图](../../imgs/1.1.1-4.png) 20 | 21 | 上图是 DAC(数字模拟转换器)电路,DAC 是英文单词 Digital to Analog Converter 的缩写。在很多数字系统中(例如计算机),信号以数字方式存储和传输,而数字模拟转换器可以将这样的信号转换为模拟信号,从而使得它们能够被外界(人或其他非数字系统)识别,从这张图中可以看到上面的 2.5V 电压的用处,这里的 2.5V 是作为输入的基准电压。与 DAC 对应的还有 ADC ,顾名思义,ADC 的作用是将模拟信号转化为数字信号。很多传感器输出的事模拟信号,而MCU无法读取模拟信号,只能通过 ADC 将模拟信号先转化为数字信号,再进行读取。在选择传感器(如加速度、重力等传感器),这些传感器一半都有数字传感器或模拟传感器,数字传感器往往比模拟传感器精准。PWM 是英文单词 Pulse Width Modulation(脉冲宽度调制) 的缩写。脉冲宽度调制是利用微处理器的数字输出来对模拟电路进行控制的一种非常有效的技术,广泛应用在从测量、通信到功率控制与变换的许多领域中。最典型的例子就是用 PWM 控制电机转速,而目前市面上的多数 MCU 都带有 PWM 模块。51等传统单片机是没有 PWM 模块的,往往可以通过程序模拟,或外接 PWM 模块支持。 22 | 23 | ## GPIO 24 | ![GPIO电路图](../../imgs/1.1.1-5.png) 25 | GPIO 是英文单词 General Purpose Input Output(通用输入/输出)的缩写。对于程序员来说,GPIO 应该是我们接触最多也最熟悉的部分了。控制外接电路,往往是连接 GPIO 管脚。使用树莓派,无论用 node、python、C# 或者是其他语言,往往都会引用一个 GPIO 的库来进行控制,而这些库往往又是基于 C 或 C++ 进行的底层操作。不引用第三方库,直接用 C 对这些管脚进行控制也是相当简单的。比如,硬件领域的 “hello world”(点亮 LED 灯),只需要对一个管脚写入0或1,便可控制 LED 亮灭。上面第一张图可以注意到,很多管脚是具有第二功能的,比如上面的两路输出 PWM 的管脚以及 SD 卡相关的管脚。下图中有两个管脚需要格外注意,TXD 及 RXD 这是串口通信的管脚,串口通信对应的还有并口通信,串口通信相比较并口通信的优势就是在于拿时间换取空间。 26 | 27 | ## SD卡 28 | 29 | ![SD卡电路](../../imgs/1.1.1-6.png) 30 | 31 | 从上面的图可以看到需要操作的管脚是4、5、2、7、8、9、1几个管脚。SD的这个电路为通用的电路,换其它MCU时,这种连接依然可以work. 32 | 33 | ## HDMI、音频、网卡电路 34 | HDMI和音频是系统芯片内部的功能,主要按照数据手册里方式的进行连接。该图也较为复杂,就没有必要贴出来了。网卡及串口在树莓派中借助的是 LAN9512 芯片,Microchip公司生产的 LAN9512/LAN9512i 是第一款工业的全集成、高速2.0 USB、高性能10/100M网络控制器。具体的电路连接也是需要阅读 LAN9512 的数据手册。 35 | 36 | ## 树莓派正面 37 | 38 | ![树莓派正面](../../imgs/1.1.1-7.png) 39 | 40 | 上面位于正中心的那块是这个系统的核心芯片 BCM2835,左边为 LAN9154,布局的规则也决定,网卡接口及USB接口设计在了 LAN9154 的右边。USB供电系统旁边有三个转压芯片,这一部分区域是给系统提供4种电压。树莓派为双层板,正面布满系统需要的绝大部分元器件。 41 | 42 | ![树莓派反面](../../imgs/1.1.1-8.png) 43 | 44 | PCB 板反面右边是SD卡接口,中心是一个19.2MHZ的晶振,对应正面中心的 BCM2835 芯片。 45 | -------------------------------------------------------------------------------- /1/1-1/1-1-2.md: -------------------------------------------------------------------------------- 1 | # 树莓派软件系统 2 | 树莓派和其它MUC一样,可以直接以汇编或C语言进行编程,在编写一些简单的程序时,是不会有什么问题的。编写复杂的程序,这样显然会更加吃力。而且学习成本也高,往往我们需要关心的不是用何种语言去编程,而是不要管底层驱动。跟树莓派装上操作系统,便可以解决这些问题。树莓派官方提供了很多可选的[系统镜像](https://www.raspberrypi.org/downloads/),这里会以两款比较流行的系统,树莓派官方系统Raspbian及win10 iot进行安装学习。 3 | 4 | ## mac下安装Raspbian 5 | 6 | windows下有现成的工具可用,所以windows下其实更简单,但手头没有可用的windows系统,就用mac给树莓派装系统。 7 | ### 下载镜像 8 | 可以到树莓派[官方下载地址](https://www.raspberrypi.org/downloads/),下载镜像。我选择Raspbian,官方的一个操作系统。 9 | ### 安装系统 10 | * 将SD卡插到电脑上,输入```df -h```查看已经挂在的卷。(可以找到我们的SD卡在系统里对应的设备文件) 11 | * 使用```diskutil unmount```将这些分区卸载。(如我的SD卡在系统里对应的设备文件/dev/disk4s1,则需要使用‘’‘diskutil unmount /dev/disk4s1将SD卡分区卸载。) 12 | * 再使用```diskutil list```确认/dev/disk4s1已被卸载。 13 | * 使用dd命令将系统镜像写入。 14 | * ```dd bs=4m if=2016-02-09-jessie-raspbian.img of=/dev/rdisk4```` 15 | 16 | SD系统写入成功。 17 | 18 | ![](../../imgs/1.1.2-0.png) 19 | 20 | #### PS: 21 | 22 | * 系统镜像分‘Full desktop image’和‘Minimal image based on Debian Jessie’,我安装的是前面的,太大了,以至于32G的SD不够用,开发的还是建议按装lite版本。 23 | * 如果第一次安装树莓派,外接显示器可能无法连接,需要修改配置文件config.txt里的参数 24 | 25 | ``` 26 | hdmi_safe=1 //取消注释 27 | config_hdmi_boost=4 //取消注释 28 | ``` 29 | ### 连接树莓派 30 | 采用ssh的方式连接树莓派,mac下下了一个Ip Scanner查看局域网里设备ip地址。找到Raspberra pi的ip地址。 31 | ![](../../imgs/1.1.2-1.png) 32 | 33 | 树莓派默认的账户: pi,密码:raspberry。(之前的操作系统必须先链接显示器,用键盘确认),ssh首次登录会生成密钥,选择yes,连接```ssh pi@ip```,输入密码,登录成功。 34 | 35 | ![](https://img.alicdn.com/tps/TB1fD.MLFXXXXaFXpXXXXXXXXXX-564-155.png) 36 | 37 | 由于我的系统时重装的,所以登录时会报错。本机直接输入```ssh-keygen -R hostname```重新生成密钥即可。 38 | 39 | ![](https://gw.alicdn.com/tps/TB1RsZSLFXXXXa5XXXXXXXXXXXX-564-364.png) 40 | 41 | ### 安装nodejs 42 | 因为项目时基于node开发的,所以只需要装一下node即可。树莓派使用的架构用的架构是ARMv6,所以需要下载一个ARMv6版本的node,linux下下载命令``` wget https://nodejs.org/dist/v4.3.1/node-v4.3.1-linux-armv6l.tar.xz ``` 43 | 44 | ![](../../imgs/1.1.2-4.png) 45 | 46 | 等待下载,家里网速太慢。。。 47 | 48 | 下载成功之后需要解压.xz文件,先```xz -d xxx.tar.xz```将xxx.tar.xz解压成xxx.tar。然后,再用 ```tar xvf xxx.tar```来解包 49 | 50 | ![](../../imgs/1.1.2-3.png) 51 | 52 | 由于node已经编译过了,不需要在本地编译了,直接使用即可,done. 53 | 54 | ### 测试Demo 55 | 56 | ![](../../imgs/1.1.2-5.png) 57 | 58 | ![](../../imgs/1.1.2-6.png) 59 | 60 | ![](../../imgs/1.1.2-7.png) 61 | 62 | Done,环境搭建完成。 -------------------------------------------------------------------------------- /1/1-2/1-2-0.md: -------------------------------------------------------------------------------- 1 | # Ardunio 2 | Arduino 是一款比较流行的开源硬件,相对于传统的硬件平台,Arduino所具有的优势就是采用 Creative Commons 许可。 Creative Commons(CC)是为保护开放版权行为而出现的类似GPL的一种许可(license)。在 Creative Commons许 可下,任何人都被允许生产电路板的复制品,还能重新设计,甚至销售原设计的复制品。Ardunio 其实是包含硬件部分(各种型号的Arduino板)和软件部分(Arduino IDE)。 3 | 4 | ## Arduino板 5 | Ardunio 开发板众多,仅主板就有各种系列,还有各种对应扩展板和传感器。Ardunio 基本都是采用 Atmel 公司的16位及32位芯片。下面是几款主要的Ardunio 发板: 6 | 7 | ### Arduino Uno 8 | ![](../../imgs/1.2-1.jpg) 9 | 10 | 广受青睐的 Arduino Uno 开发板是以 ATmega328 MCU 控制器为基础。而 ATmega328 是一款低功耗,高性能的 AVR® 8位微处理器,这款芯片采用的是精简指令集计算机(RISC)架构,4/8/16/32K 11 | 字节系统内可编程闪存。Arduino Uno 开发板所具有的特性都是来自于 ATmega328 这款芯片。更多特性可以查看 [ATmega328官方数据手册](http://www.alldatasheet.com/view.jsp?Searchword=ATMEGA328)。 12 | 13 | 14 | ### Arduino Nano 15 | ![](../../imgs/1.2-9.jpg) 16 | 17 | Arduino Nano 是一款基于 ATmega328(Arduino Nano 3.x) 或 ATmega168(Arduino Nano2.x)的开发卡,体积小巧、功能全面且适用于电路板。 18 | 19 | ### Arduino Due 20 | ![](../../imgs/1.2-3.jpg) 21 | 22 | 与前两款不同,Arduino Due 是基于 ATSAM3X8EA 芯片。而 ATSAM3X8EA 是32位 ARM Cortex-M3 RISC 处理器,Cortex-M3 处理器采用 ARMv7-M 架构。更多细节可以查看[ATSAM3X8EA](http://html.alldatasheet.com/html-pdf/475970/ATMEL/ATSAM3X8EA-AU/318/2/ATSAM3X8EA-AU.html). 23 | 24 | ### Arduino Mega(2560) 25 | ![](../../imgs/1.2-6.jpg) 26 | 27 | Arduino Mega 采用 ATmega2560 作为核心处理器。ATmega2560 是一款256K字节系统内可编程闪存的微处理器,这里不再做过多介绍,更多内容可以看[数据手册](http://html.alldatasheet.com/html-pdf/107092/ATMEL/ATMEGA2560/153/1/ATMEGA2560.html) 28 | 29 | ### Arduino Zero 30 | ![](../../imgs/1.2-11.png) 31 | 32 | Arduino Zero 采用的 SAMD21 作为主控制器,而SAMD21 是32位ARM Cortex M0+ 内核,CortexM0 其核心架构为 ARMv6M,关于 ARM 架构会在 ARM 章节进行讲解。Arduino Zero 是 Atmel 与 Arduino 合作推出 Zero 开发板,它是一款简洁、优雅、功能强大的32位平台扩展板。附上[SAMD20手册](http://html.alldatasheet.com/html-pdf/554411/ATMEL/ATSAMD20E14A-AU/322/2/ATSAMD20E14A-AU.html) 33 | 34 | ### Arduino Yún 35 | ![](../../imgs/1.2-4.jpg) 36 | 37 | ArduinoYún的比较独特,采用了 ATmega32U4 处理器,同时还带有 AtherosAR9331(wifi模块),而主芯片则和 Arduino Leonardo 相同。不同的是Yún板具备内置以太网和Wi-Fi支持器,Yún还可以与板上Linux分配通信,Arduino带来了功能强大的联网计算机。 38 | 39 | ![](../../imgs/1.2-13.png) 40 | 以上是 Ardunio 的系列产品,除此之外还有很多已经废弃的产品,更多 Ardunio 产品看查看[Arduino Products](https://www.arduino.cc/en/Main/Products) 41 | 42 | ## Ardunio IDE 43 | Ardunio IDE 同时支持 windows、linux、mac 三种平台,适用于任何 Ardunio 板。具体安装和使用方法可以参照官方[Getting Started with Arduino](https://www.arduino.cc/en/Guide/HomePage), Ardunio IDE 提供了自己特有的[语法](https://www.arduino.cc/en/Reference/HomePage).很多人喜欢用 Sublime Text ,没有关系,安装 Ardunio 的插件,和 Ardunio IDE 具有的功能类似。以下是 Ardunio IDE 的界面: 44 | ![](../../imgs/1.2-12.png) 45 | 46 | -------------------------------------------------------------------------------- /1/1-2/1-2-1.md: -------------------------------------------------------------------------------- 1 | # Arduino UNO硬件介绍 2 | 3 | 本想在这一章会对照开发板简单讲解一下硬件原理图,所以如果你想深入了解硬件原理图,这里附上官网的[PDF版](https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf) 。下图是一张原理图和开发板的概览图: 4 | 5 | ![](../../imgs/1.2.1-1.png) 6 | 7 | ## 稳压电路 8 | 9 | ![](../../imgs/1.2.1-3.png) 10 | 11 | 外接电源输入进来的电压可能在5V附近,为了保证更加精准的5V电压,防止电压过高穿透芯片。这里选用的是 NCP117ST50T3G 稳压芯片,这款稳压芯片输出电压可调范围是1.5-12V。稳压电路的连接方式及计算公式可查[此链接](http://html.alldatasheetcn.com/html-pdf/174874/ONSEMI/NCP1117ST50T3G/1826/8/NCP1117ST50T3G.html)。 12 | 13 | ## 下载电路 14 | 15 | ![](../../imgs/1.2.1-4.png) 16 | ![](../../imgs/1.2.1-5.png) 17 | 18 | 这块 UNO 板采用 Atmega16U2 芯片做下载电路,一般我们可能需要单独的下载模块下载程序,但此开发板直接将下载电路集成到了开发板上。这里直接可连 USB 线进行下载,像 Ardunino mini 这种小系统板是需要单独的下载模块的。 19 | 20 | ## 主芯片最小系统 21 | 22 | ![](../../imgs/1.2.1-6.png) 23 | ![](../../imgs/1.2.1-7.png) 24 | 25 | 如上图,这里可以独立出 UNO 的最小系统板,我们编程最关心的就是这个最小系统的 GPIO 接口。晶振的选择几个元器件的选择可参考 Atmega328 数据手册。下图是我们经常操作的一些管脚,比如,我们下一章节将要用的的开发板中的13管脚,它对应的是芯片的19管脚,B端口的第五个管脚,而除了作为普通的 IO 管脚外,它的第二功能就是SCK(同步时钟),SPI通信中作为时钟信号。 26 | ![](../../imgs/1.2.1-8.png) 27 | -------------------------------------------------------------------------------- /1/1-2/1-2-2.md: -------------------------------------------------------------------------------- 1 | # 点亮LED灯 2 | 3 | 上一节介绍了 Ardunio UNO 的硬件结构,这一节将会写一个 UNO 的 “hello word” 程序,在软件领域通常会以输出 “hello word” 作为开始,而在硬件领域通常是以点亮 LED 灯作为开始。 4 | 5 | ## 搭建环境 6 | 首先,在编写程序之前,需要下载编译环境和安装驱动。这里以mac为例,具体的下载过程可以参考官方的[Getting Started w/ Arduino on Mac OS X](https://www.arduino.cc/en/Guide/MacOSX)。从官方下载IDE时可能需要先捐献才能下载,为了表示对IDE的支持,我捐献了两美元。当然如果你没有信用卡或者其他的合适的支付手段,这里提供一个第三方的[下载平台](http://www.maczapp.com/arduino)。按照上述方法安装完毕之后,需要再安装串口驱动,[下载链接](http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_2_18.dmg)。驱动安装完毕之后,可以检查驱动是否安装成功。插上连接线,输入```ls /dev/tty.*``` 7 | 8 | ![](../../imgs/1.2.2-1.png) 9 | 10 | 这里是“/dev/tty.usbmodem1421”,驱动安装成功。 11 | 12 | ## 更改配置 13 | 在编写程序之前,还需要更改一些配置项: 14 | 15 | 第一步,选择对应的开发板,这里选用的是 UNO 开发板。 16 | 17 | ![](../../imgs/1.2.2-2.png) 18 | 19 | 第二部,选择对应的下载端口,上面打印的端口是“/dev/tty.usbmodem1421”,这里选择它。 20 | 21 | ![](../../imgs/1.2.2-3.png) 22 | 23 | ## 编写程序 24 | Ardunio 采用自己的一套语言规范,程序可以被分解为三个主要部分:结构、值(变量和常量)以及函数。 25 | 一般结构中包含两个函数:“setup()”、“loop()”。“setup()” 是在“sketch”开始时被调用的,用于初始化变量、管脚、开始使用库文件等等。这个函数只会在开发板上电或复位时被调用一次。而“loop()”函数则是在“setup()”函数执行完毕后,一直循环执行。点亮 LED 的思路是只需要在程序开始时,将 LED 置于点亮状态。上一章可以看到,UNO 开发板的13管脚连接在 LED 的灯的一端,而 LED 的灯另一端连接到了低电平,也就是说,只需在初始化时,给13管脚上赋上高电平便可完成操作。 26 | 27 | ``` 28 | // the setup function runs once when you press reset or power the board 29 | void setup() { 30 | // initialize digital pin 13 as an output. 31 | pinMode(13, OUTPUT); 32 | // turn the LED on (HIGH is the voltage level) 33 | digitalWrite(13, HIGH); 34 | } 35 | 36 | // the loop function runs over and over again forever 37 | void loop() { 38 | 39 | } 40 | ``` 41 | 42 | 编译下载到 UNO 板中,Done,效果如下: 43 | 44 | ![](../../imgs/1.2.2-4.png) -------------------------------------------------------------------------------- /1/1-4/intro.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/1/1-4/intro.md -------------------------------------------------------------------------------- /1/1-4/producer.md: -------------------------------------------------------------------------------- 1 | Atmel公司:http://www.atmel.com/products/microcontrollers/default.aspx 2 | 一共有3个系列的单片机AT89、AT90、AT91 3 | AT89是以51内核为标准的单片机。 4 | AT90系列单片机主要对应的是AVR单片机(这是Atmel的最主要的单片机了)。 5 | AT91系列单片机主要对应的是高端的32位ARM单片机。 -------------------------------------------------------------------------------- /2/2-0.md: -------------------------------------------------------------------------------- 1 | # 硬件编程 2 | 3 | TODO -------------------------------------------------------------------------------- /2/2-1.md: -------------------------------------------------------------------------------- 1 | # 选用那种语言 2 | 现如今,绝大多数嵌入式设备选用的是 C/C++ 语言,对于一些实时性较高的语言则选用汇编语言。但是随着硬件设备的性能提升,越来越有可能选用自己熟悉的语言进行编程,比如java、C#、javascript、python等。目前,在一些高端的微处理器(如树莓派)上已经可以使用这些语言进行编程,大多数 MCU (绝大多数8/16位芯片)的编译环境都是将 C 语言编译成16进制文件烧录到芯片中执行。所以,当选用一个自己熟悉的语言在低端芯片中编程时,可能无法借助现有的编译器完成。本文以 Ardunio UNO (8位芯片)为例,用 Javascript 编写一个硬件的“Hello World”(点亮LED)程序。 3 | 4 | ## 下载程序 5 | MCU 下载程序需要软硬件共同支持,一般会使用现成的 IDE 工具,极少会关注到这些。那么将一段程序下载到 MCU 中需要哪些支持呢?这里以 Ardunio UNO 为例进行讲解。将一段程序下载到 Ardunio UNO ,Ardunio UNO 依靠 ATmega32U4/ATmega16U2(不同版本的 UNO 使用的芯片不同,高版本的有所升级)等 进行下载。而 ATmega32U4/ATmega16U2 等是 USB 接口芯片,是将 PC 发送的信号传递到 UNO 主芯片的中枢。从第一章的电路图可以看出,ATmega16U2 芯片可以将 USB 信号转换为 ISP、串口信号等,而这里是将其转化为串口信号下载到主芯片(不同厂商、不同芯片支持不同的下载方式)。另一方面,不同平台电脑也会装上对应的驱动(第一章安装环境中有提到),ATmega16U2 内置 Bootloader ,按照特定的协议与 PC 通信。这里特别提一下,ATmega16U2 系列芯片支持固件升级,需要借助官方提供的软件[Flip](http://www.atmel.com/tools/flip.aspx)对其升级,对应的固件[megaUSB_DFU_Bootloaders](http://www.atmel.com/Images/megaUSB_DFU_Bootloaders.zip)都是16进制文件。下图是 ATmega16U2 等硬件及 Boot 处理流程: 6 | 7 | ![](../imgs/2.1-1.png) 8 | 9 | ## JS点亮LED 10 | Arduino IDE 是不支持 Javascript 语法的,这里无法使用 Arduino IDE 进行 Js 编程。首先,需要用 js 编写程序,然后将 js 程序写入到 arduino 中。这里需要一个协议来支持 PC 与 MCU 的通信。而 Arduino IDE 本身集成 [Firmata 协议](http://firmata.org/wiki/Main_Page)(准确的说是 Firmata 从 Aduino 抽离出来的)。这里首先需要做的事讲 Firmata 协议的 Arduino 实现烧写到芯片中。然后,用 js 实现 Firmata 协议,PC 通过 Firmata 协议控制 Arduino. 11 | 12 | ### 烧写Firmata协议 13 | Arduino IDE 本身是集成了 Firmata,只需要找到这个程序,烧写到 arduino 中即可,具体位置如下图: 14 | 15 | ![](../imgs/2.1-2.png) 16 | 17 | ### PC端程序 18 | 首先,要实现 PC 与 MCU 的 Firmata 协议,这里直接借助 [firmata.js](https://github.com/firmata/firmata.js),firmata.js 实现了用 PC 端用 js 与 MCU 的 Firmata 通信。在这个基础上,编写“Hello World”。连接 USB 线,找到对应的设备端口```ls /dev/tty.usb*```: 19 | 20 | ![](../imgs/2.1-3.png) 21 | 22 | 编写程序,当 PC 和 MCU 与连接成功之后,将 Arduino 的13(连接LED)管脚置为高电平。将刚才显示的设备端口写到以下程序中: 23 | 24 | ``` 25 | var Board = require("firmata"); 26 | var board = new Board("/dev/tty.usbmodem1421"); 27 | 28 | board.on("ready", function() { 29 | // Arduino is ready to communicate 30 | console.log('connet'); 31 | board.digitalWrite(13, 1) 32 | }); 33 | ``` 34 | 35 | 如图,连接成功,开发板 LED 点亮: 36 | 37 | ![](../imgs/2.1-4.png) 38 | 39 | ![](../imgs/2.1-5.png) 40 | 41 | 上面就实现了用 js 控制硬件,当想用 js 编写复杂的程序是,也可以依赖一些现成的 js 库,这里推荐一个 [johnny-five](https://github.com/rwaldron/johnny-five)。同样,用其他的语言也可以实现,只需要使用 Firmata 对应的实现。[Firmata client libraries](https://github.com/firmata/protocol),这个文档中列出各种语言对 Firmata 实现的库。 42 | 43 | 44 | -------------------------------------------------------------------------------- /2/2-2.md: -------------------------------------------------------------------------------- 1 | # Arduino液晶显示 2 | 3 | 这一章会以 Arduino 控制液晶显示为例,主要去讲解如何通过读硬件的数据手册,对硬件进行编程。 4 | 5 | ## 效果图演示 6 | ![](../imgs/2.2-1.jpg) 7 | 8 | 9 | TODO -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简介 2 | 项目进行中,问题可提至[issue](https://github.com/sundway/iot-book/issues) -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | * [微控制器](1/1-0.md) 2 | * [树莓派](1/1-1/1-1-0.md) 3 | * [树莓派硬件系统](1/1-1/1-1-1.md) 4 | * [树莓派软件系统](1/1-1/1-1-2.md) 5 | * [Arduino](1/1-2/1-2-0.md) 6 | * [Arduino UNO硬件介绍](1/1-2/1-2-1.md) 7 | * [点亮LED](1/1-2/1-2-2.md) 8 | * [ARM]() 9 | * [单片机]() 10 | * [硬件编程](2/2-0.md) 11 | * [选用何种语言](2/2-1.md) 12 | * [Arduino液晶显示](2/2-2.md) -------------------------------------------------------------------------------- /_book/.gitigore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store* 3 | Icon? 4 | ._* 5 | 6 | # Windows 7 | Thumbs.db 8 | ehthumbs.db 9 | Desktop.ini 10 | 11 | # Linux 12 | directory 13 | *~ 14 | -------------------------------------------------------------------------------- /_book/1/1-0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 微控制器 | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

微控制器

307 |

微控制器也叫MCU(Microcontroller Unit)。微控器种类繁多,有很多种维度进行区分。比如:架构,功耗,封装。本章主页介绍目前市面比较流行的两款开源硬件,树莓派以及arduino.

308 |

TODO

309 | 310 | 311 |
312 | 313 | 314 |
315 |
316 |
317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 |
325 |
326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 352 | 353 | 354 | 355 | 356 | 357 | -------------------------------------------------------------------------------- /_book/1/1-1/1-1-0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 树莓派 | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

树莓派

307 |

树莓派简介

308 |

Raspberry Pi,中文名:树莓派。树莓派由注册于英国的慈善组织“Raspberry Pi 基金会”开发,旨在于学生计算机编程教育,树莓派官方的关键词就是:"Teach, Learn, and Make with Raspberry Pi"。在2006年,树莓派早期概念是基于Atmel(Atmel公司会在单片机一章中有介绍)的 ATmega644单片机。2012年2月29日,树莓派基金会发布了256MB内存的树莓派B型。四年后,也就是2016年2月29号,基金会宣布树莓派3 B型将以35美元的价格发售。

309 |

树莓参数对比

310 |

与前三款比较(包括树莓派 B+),树莓派3在硬件配置上有什么不一样呢? 311 | 以下是主要几款树莓派(不包括树莓派A+及Zero)的主要参数对比:

312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 |
硬件A型 (一代)B型 (二代)B+版树莓派3 B型
CPUARM1176JZF-S核心(ARM11系列)700MHz900MHz的四核 Cortex-A7同左1.2GHz 四核 64 位 ARMv8 处理器
SoC(系统级芯片 )Broadcom BCM2835Broadcom BCM2835同左Broadcom BCM2837
GPU(图形处理器)Broadcom VideoCore IV, OpenGL ES 2.0, 1080p 30 h.264/MPEG-4 AVC 高清解码器同左同左同左
内存256MB512MB512MB1GB
353 |

据说,树莓派3外观相对前几款树莓派并没有太多变化,但性能提升了50%。而且,就在树莓派3发布几天之后,windows 10 iot就提供了支持对树莓派3的支持,可以看出大家对这款卡片机的青睐。于是,我特意查了一下BCM2835以及BCM2837这两款系统级芯片,但里面主要介绍了树莓的外围扩展,定时器,中断,GPIO,PWM等,有更高的项目需求可以看看。如果想看具体的芯片书册,可到datasheet进行下载,附上BCM2835链接。

354 | 355 | 356 |
357 | 358 | 359 |
360 |
361 |
362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 |
370 |
371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 397 | 398 | 399 | 400 | 401 | 402 | -------------------------------------------------------------------------------- /_book/1/1-1/1-1-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 树莓派软件系统 | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

树莓派软件系统

307 |

树莓派和其它MUC一样,可以直接以汇编或C语言进行编程,在编写一些简单的程序时,是不会有什么问题的。编写复杂的程序,这样显然会更加吃力。而且学习成本也高,往往我们需要关心的不是用何种语言去编程,而是不要管底层驱动。跟树莓派装上操作系统,便可以解决这些问题。树莓派官方提供了很多可选的系统镜像,这里会以两款比较流行的系统,树莓派官方系统Raspbian及win10 iot进行安装学习。

308 |

mac下安装Raspbian

309 |

windows下有现成的工具可用,所以windows下其实更简单,但手头没有可用的windows系统,就用mac给树莓派装系统。

310 |

下载镜像

311 |

可以到树莓派官方下载地址,下载镜像。我选择Raspbian,官方的一个操作系统。

312 |

安装系统

313 |
    314 |
  • 将SD卡插到电脑上,输入df -h查看已经挂在的卷。(可以找到我们的SD卡在系统里对应的设备文件)
  • 315 |
  • 使用diskutil unmount将这些分区卸载。(如我的SD卡在系统里对应的设备文件/dev/disk4s1,则需要使用‘’‘diskutil unmount /dev/disk4s1将SD卡分区卸载。)
  • 316 |
  • 再使用diskutil list确认/dev/disk4s1已被卸载。
  • 317 |
  • 使用dd命令将系统镜像写入。
      318 |
    • dd bs=4m if=2016-02-09-jessie-raspbian.img of=/dev/rdisk4`
    • 319 |
    320 |
  • 321 |
322 |

SD系统写入成功。

323 |

324 |

PS:

325 |
    326 |
  • 系统镜像分‘Full desktop image’和‘Minimal image based on Debian Jessie’,我安装的是前面的,太大了,以至于32G的SD不够用,开发的还是建议按装lite版本。
  • 327 |
  • 如果第一次安装树莓派,外接显示器可能无法连接,需要修改配置文件config.txt里的参数
  • 328 |
329 |
hdmi_safe=1 //取消注释
330 | config_hdmi_boost=4 //取消注释
331 | 

连接树莓派

332 |

采用ssh的方式连接树莓派,mac下下了一个Ip Scanner查看局域网里设备ip地址。找到Raspberra pi的ip地址。 333 |

334 |

树莓派默认的账户: pi,密码:raspberry。(之前的操作系统必须先链接显示器,用键盘确认),ssh首次登录会生成密钥,选择yes,连接ssh pi@ip,输入密码,登录成功。

335 |

336 |

由于我的系统时重装的,所以登录时会报错。本机直接输入ssh-keygen -R hostname重新生成密钥即可。

337 |

338 |

安装nodejs

339 |

因为项目时基于node开发的,所以只需要装一下node即可。树莓派使用的架构用的架构是ARMv6,所以需要下载一个ARMv6版本的node,linux下下载命令wget https://nodejs.org/dist/v4.3.1/node-v4.3.1-linux-armv6l.tar.xz

340 |

341 |

等待下载,家里网速太慢。。。

342 |

下载成功之后需要解压.xz文件,先xz -d xxx.tar.xz将xxx.tar.xz解压成xxx.tar。然后,再用 tar xvf xxx.tar来解包

343 |

344 |

由于node已经编译过了,不需要在本地编译了,直接使用即可,done.

345 |

测试Demo

346 |

347 |

348 |

349 |

Done,环境搭建完成。

350 | 351 | 352 |
353 | 354 | 355 |
356 |
357 |
358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 |
366 |
367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 393 | 394 | 395 | 396 | 397 | 398 | -------------------------------------------------------------------------------- /_book/1/1-2/1-2-0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Arduino | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

Ardunio

307 |

Arduino 是一款比较流行的开源硬件,相对于传统的硬件平台,Arduino所具有的优势就是采用 Creative Commons 许可。 Creative Commons(CC)是为保护开放版权行为而出现的类似GPL的一种许可(license)。在 Creative Commons许 可下,任何人都被允许生产电路板的复制品,还能重新设计,甚至销售原设计的复制品。Ardunio 其实是包含硬件部分(各种型号的Arduino板)和软件部分(Arduino IDE)。

308 |

Arduino板

309 |

Ardunio 开发板众多,仅主板就有各种系列,还有各种对应扩展板和传感器。Ardunio 基本都是采用 Atmel 公司的16位及32位芯片。下面是几款主要的Ardunio 发板:

310 |

Arduino Uno

311 |

312 |

广受青睐的 Arduino Uno 开发板是以 ATmega328 MCU 控制器为基础。而 ATmega328 是一款低功耗,高性能的 AVR® 8位微处理器,这款芯片采用的是精简指令集计算机(RISC)架构,4/8/16/32K 313 | 字节系统内可编程闪存。Arduino Uno 开发板所具有的特性都是来自于 ATmega328 这款芯片。更多特性可以查看 ATmega328官方数据手册

314 |

Arduino Nano

315 |

316 |

Arduino Nano 是一款基于 ATmega328(Arduino Nano 3.x) 或 ATmega168(Arduino Nano2.x)的开发卡,体积小巧、功能全面且适用于电路板。

317 |

Arduino Due

318 |

319 |

与前两款不同,Arduino Due 是基于 ATSAM3X8EA 芯片。而 ATSAM3X8EA 是32位 ARM Cortex-M3 RISC 处理器,Cortex-M3 处理器采用 ARMv7-M 架构。更多细节可以查看ATSAM3X8EA.

320 |

Arduino Mega(2560)

321 |

322 |

Arduino Mega 采用 ATmega2560 作为核心处理器。ATmega2560 是一款256K字节系统内可编程闪存的微处理器,这里不再做过多介绍,更多内容可以看数据手册

323 |

Arduino Zero

324 |

325 |

Arduino Zero 采用的 SAMD21 作为主控制器,而SAMD21 是32位ARM Cortex M0+ 内核,CortexM0 其核心架构为 ARMv6M,关于 ARM 架构会在 ARM 章节进行讲解。Arduino Zero 是 Atmel 与 Arduino 合作推出 Zero 开发板,它是一款简洁、优雅、功能强大的32位平台扩展板。附上SAMD20手册

326 |

Arduino Yún

327 |

328 |

ArduinoYún的比较独特,采用了 ATmega32U4 处理器,同时还带有 AtherosAR9331(wifi模块),而主芯片则和 Arduino Leonardo 相同。不同的是Yún板具备内置以太网和Wi-Fi支持器,Yún还可以与板上Linux分配通信,Arduino带来了功能强大的联网计算机。

329 |

330 | 以上是 Ardunio 的系列产品,除此之外还有很多已经废弃的产品,更多 Ardunio 产品看查看Arduino Products

331 |

Ardunio IDE

332 |

Ardunio IDE 同时支持 windows、linux、mac 三种平台,适用于任何 Ardunio 板。具体安装和使用方法可以参照官方Getting Started with Arduino, Ardunio IDE 提供了自己特有的语法.很多人喜欢用 Sublime Text ,没有关系,安装 Ardunio 的插件,和 Ardunio IDE 具有的功能类似。以下是 Ardunio IDE 的界面: 333 |

334 | 335 | 336 |
337 | 338 | 339 |
340 |
341 |
342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 |
350 |
351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 377 | 378 | 379 | 380 | 381 | 382 | -------------------------------------------------------------------------------- /_book/1/1-2/1-2-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Arduino UNO硬件介绍 | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

Arduino UNO硬件介绍

307 |

本想在这一章会对照开发板简单讲解一下硬件原理图,所以如果你想深入了解硬件原理图,这里附上官网的PDF版 。下图是一张原理图和开发板的概览图:

308 |

309 |

稳压电路

310 |

311 |

外接电源输入进来的电压可能在5V附近,为了保证更加精准的5V电压,防止电压过高穿透芯片。这里选用的是 NCP117ST50T3G 稳压芯片,这款稳压芯片输出电压可调范围是1.5-12V。稳压电路的连接方式及计算公式可查此链接

312 |

下载电路

313 |

314 |

315 |

这块 UNO 板采用 Atmega16U2 芯片做下载电路,一般我们可能需要单独的下载模块下载程序,但此开发板直接将下载电路集成到了开发板上。这里直接可连 USB 线进行下载,像 Ardunino mini 这种小系统板是需要单独的下载模块的。

316 |

主芯片最小系统

317 |

318 |

319 |

如上图,这里可以独立出 UNO 的最小系统板,我们编程最关心的就是这个最小系统的 GPIO 接口。晶振的选择几个元器件的选择可参考 Atmega328 数据手册。下图是我们经常操作的一些管脚,比如,我们下一章节将要用的的开发板中的13管脚,它对应的是芯片的19管脚,B端口的第五个管脚,而除了作为普通的 IO 管脚外,它的第二功能就是SCK(同步时钟),SPI通信中作为时钟信号。 320 |

321 | 322 | 323 |
324 | 325 | 326 |
327 |
328 |
329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 |
337 |
338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 364 | 365 | 366 | 367 | 368 | 369 | -------------------------------------------------------------------------------- /_book/1/1-2/1-2-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 点亮LED | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

点亮LED灯

307 |

上一节介绍了 Ardunio UNO 的硬件结构,这一节将会写一个 UNO 的 “hello word” 程序,在软件领域通常会以输出 “hello word” 作为开始,而在硬件领域通常是以点亮 LED 灯作为开始。

308 |

搭建环境

309 |

首先,在编写程序之前,需要下载编译环境和安装驱动。这里以mac为例,具体的下载过程可以参考官方的Getting Started w/ Arduino on Mac OS X。从官方下载IDE时可能需要先捐献才能下载,为了表示对IDE的支持,我捐献了两美元。当然如果你没有信用卡或者其他的合适的支付手段,这里提供一个第三方的下载平台。按照上述方法安装完毕之后,需要再安装串口驱动,下载链接。驱动安装完毕之后,可以检查驱动是否安装成功。插上连接线,输入ls /dev/tty.*

310 |

311 |

这里是“/dev/tty.usbmodem1421”,驱动安装成功。

312 |

更改配置

313 |

在编写程序之前,还需要更改一些配置项:

314 |

第一步,选择对应的开发板,这里选用的是 UNO 开发板。

315 |

316 |

第二部,选择对应的下载端口,上面打印的端口是“/dev/tty.usbmodem1421”,这里选择它。

317 |

318 |

编写程序

319 |

Ardunio 采用自己的一套语言规范,程序可以被分解为三个主要部分:结构、值(变量和常量)以及函数。 320 | 一般结构中包含两个函数:“setup()”、“loop()”。“setup()” 是在“sketch”开始时被调用的,用于初始化变量、管脚、开始使用库文件等等。这个函数只会在开发板上电或复位时被调用一次。而“loop()”函数则是在“setup()”函数执行完毕后,一直循环执行。点亮 LED 的思路是只需要在程序开始时,将 LED 置于点亮状态。上一章可以看到,UNO 开发板的13管脚连接在 LED 的灯的一端,而 LED 的灯另一端连接到了低电平,也就是说,只需在初始化时,给13管脚上赋上高电平便可完成操作。

321 |
// the setup function runs once when you press reset or power the board
322 | void setup() {
323 |   // initialize digital pin 13 as an output.
324 |   pinMode(13, OUTPUT);
325 |   // turn the LED on (HIGH is the voltage level)
326 |    digitalWrite(13, HIGH);
327 | }
328 | 
329 | // the loop function runs over and over again forever
330 | void loop() {
331 | 
332 | }
333 | 

编译下载到 UNO 板中,Done,效果如下:

334 |

335 | 336 | 337 |
338 | 339 | 340 |
341 |
342 |
343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 |
351 |
352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 378 | 379 | 380 | 381 | 382 | 383 | -------------------------------------------------------------------------------- /_book/1/1-4/intro.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/1/1-4/intro.md -------------------------------------------------------------------------------- /_book/1/1-4/producer.md: -------------------------------------------------------------------------------- 1 | Atmel公司:http://www.atmel.com/products/microcontrollers/default.aspx 2 | 一共有3个系列的单片机AT89、AT90、AT91 3 | AT89是以51内核为标准的单片机。 4 | AT90系列单片机主要对应的是AVR单片机(这是Atmel的最主要的单片机了)。 5 | AT91系列单片机主要对应的是高端的32位ARM单片机。 -------------------------------------------------------------------------------- /_book/2/2-0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 硬件编程 | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
58 | 59 | 60 |
61 | 285 |
286 | 287 |
288 |
289 | 299 | 300 |
301 |
302 | 303 | 304 |
305 | 306 |

硬件编程

307 |

TODO

308 | 309 | 310 |
311 | 312 | 313 |
314 |
315 |
316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 |
324 |
325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 351 | 352 | 353 | 354 | 355 | 356 | -------------------------------------------------------------------------------- /_book/2/2-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Arduino液晶显示 | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
56 | 57 | 58 |
59 | 283 |
284 | 285 |
286 |
287 | 297 | 298 |
299 |
300 | 301 | 302 |
303 | 304 |

Arduino液晶显示

305 |

这一章会以 Arduino 控制液晶显示为例,主要去讲解如何通过读硬件的数据手册,对硬件进行编程。

306 |

效果图演示

307 |

308 |

TODO

309 | 310 | 311 |
312 | 313 | 314 |
315 |
316 |
317 | 318 | 319 | 320 | 321 | 322 |
323 |
324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 350 | 351 | 352 | 353 | 354 | 355 | -------------------------------------------------------------------------------- /_book/gitbook/fonts/fontawesome/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/gitbook/fonts/fontawesome/FontAwesome.otf -------------------------------------------------------------------------------- /_book/gitbook/fonts/fontawesome/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/gitbook/fonts/fontawesome/fontawesome-webfont.eot -------------------------------------------------------------------------------- /_book/gitbook/fonts/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/gitbook/fonts/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /_book/gitbook/fonts/fontawesome/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/gitbook/fonts/fontawesome/fontawesome-webfont.woff -------------------------------------------------------------------------------- /_book/gitbook/images/apple-touch-icon-precomposed-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/gitbook/images/apple-touch-icon-precomposed-152.png -------------------------------------------------------------------------------- /_book/gitbook/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/gitbook/images/favicon.ico -------------------------------------------------------------------------------- /_book/gitbook/plugins/gitbook-plugin-fontsettings/buttons.js: -------------------------------------------------------------------------------- 1 | require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) { 2 | var fontState; 3 | 4 | var THEMES = { 5 | "white": 0, 6 | "sepia": 1, 7 | "night": 2 8 | }; 9 | 10 | var FAMILY = { 11 | "serif": 0, 12 | "sans": 1 13 | }; 14 | 15 | // Save current font settings 16 | function saveFontSettings() { 17 | gitbook.storage.set("fontState", fontState); 18 | update(); 19 | } 20 | 21 | // Increase font size 22 | function enlargeFontSize(e) { 23 | e.preventDefault(); 24 | if (fontState.size >= 4) return; 25 | 26 | fontState.size++; 27 | saveFontSettings(); 28 | }; 29 | 30 | // Decrease font size 31 | function reduceFontSize(e) { 32 | e.preventDefault(); 33 | if (fontState.size <= 0) return; 34 | 35 | fontState.size--; 36 | saveFontSettings(); 37 | }; 38 | 39 | // Change font family 40 | function changeFontFamily(index, e) { 41 | e.preventDefault(); 42 | 43 | fontState.family = index; 44 | saveFontSettings(); 45 | }; 46 | 47 | // Change type of color 48 | function changeColorTheme(index, e) { 49 | e.preventDefault(); 50 | 51 | var $book = $(".book"); 52 | 53 | if (fontState.theme !== 0) 54 | $book.removeClass("color-theme-"+fontState.theme); 55 | 56 | fontState.theme = index; 57 | if (fontState.theme !== 0) 58 | $book.addClass("color-theme-"+fontState.theme); 59 | 60 | saveFontSettings(); 61 | }; 62 | 63 | function update() { 64 | var $book = gitbook.state.$book; 65 | 66 | $(".font-settings .font-family-list li").removeClass("active"); 67 | $(".font-settings .font-family-list li:nth-child("+(fontState.family+1)+")").addClass("active"); 68 | 69 | $book[0].className = $book[0].className.replace(/\bfont-\S+/g, ''); 70 | $book.addClass("font-size-"+fontState.size); 71 | $book.addClass("font-family-"+fontState.family); 72 | 73 | if(fontState.theme !== 0) { 74 | $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); 75 | $book.addClass("color-theme-"+fontState.theme); 76 | } 77 | }; 78 | 79 | function init(config) { 80 | var $bookBody, $book; 81 | 82 | //Find DOM elements. 83 | $book = gitbook.state.$book; 84 | $bookBody = $book.find(".book-body"); 85 | 86 | // Instantiate font state object 87 | fontState = gitbook.storage.get("fontState", { 88 | size: config.size || 2, 89 | family: FAMILY[config.family || "sans"], 90 | theme: THEMES[config.theme || "white"] 91 | }); 92 | 93 | update(); 94 | }; 95 | 96 | 97 | gitbook.events.bind("start", function(e, config) { 98 | var opts = config.fontsettings; 99 | 100 | // Create buttons in toolbar 101 | gitbook.toolbar.createButton({ 102 | icon: 'fa fa-font', 103 | label: 'Font Settings', 104 | className: 'font-settings', 105 | dropdown: [ 106 | [ 107 | { 108 | text: 'A', 109 | className: 'font-reduce', 110 | onClick: reduceFontSize 111 | }, 112 | { 113 | text: 'A', 114 | className: 'font-enlarge', 115 | onClick: enlargeFontSize 116 | } 117 | ], 118 | [ 119 | { 120 | text: 'Serif', 121 | onClick: _.partial(changeFontFamily, 0) 122 | }, 123 | { 124 | text: 'Sans', 125 | onClick: _.partial(changeFontFamily, 1) 126 | } 127 | ], 128 | [ 129 | { 130 | text: 'White', 131 | onClick: _.partial(changeColorTheme, 0) 132 | }, 133 | { 134 | text: 'Sepia', 135 | onClick: _.partial(changeColorTheme, 1) 136 | }, 137 | { 138 | text: 'Night', 139 | onClick: _.partial(changeColorTheme, 2) 140 | } 141 | ] 142 | ] 143 | }); 144 | 145 | 146 | // Init current settings 147 | init(opts); 148 | }); 149 | }); 150 | 151 | 152 | -------------------------------------------------------------------------------- /_book/gitbook/plugins/gitbook-plugin-fontsettings/website.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Theme 1 3 | */ 4 | .color-theme-1 .dropdown-menu { 5 | background-color: #111111; 6 | border-color: #7e888b; 7 | } 8 | .color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { 9 | border-bottom: 9px solid #111111; 10 | } 11 | .color-theme-1 .dropdown-menu .buttons { 12 | border-color: #7e888b; 13 | } 14 | .color-theme-1 .dropdown-menu .button { 15 | color: #afa790; 16 | } 17 | .color-theme-1 .dropdown-menu .button:hover { 18 | color: #73553c; 19 | } 20 | /* 21 | * Theme 2 22 | */ 23 | .color-theme-2 .dropdown-menu { 24 | background-color: #2d3143; 25 | border-color: #272a3a; 26 | } 27 | .color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { 28 | border-bottom: 9px solid #2d3143; 29 | } 30 | .color-theme-2 .dropdown-menu .buttons { 31 | border-color: #272a3a; 32 | } 33 | .color-theme-2 .dropdown-menu .button { 34 | color: #62677f; 35 | } 36 | .color-theme-2 .dropdown-menu .button:hover { 37 | color: #f4f4f5; 38 | } 39 | .book .book-header .font-settings .font-enlarge { 40 | line-height: 30px; 41 | font-size: 1.4em; 42 | } 43 | .book .book-header .font-settings .font-reduce { 44 | line-height: 30px; 45 | font-size: 1em; 46 | } 47 | .book.color-theme-1 .book-body { 48 | color: #704214; 49 | background: #f3eacb; 50 | } 51 | .book.color-theme-1 .book-body .page-wrapper .page-inner section { 52 | background: #f3eacb; 53 | } 54 | .book.color-theme-2 .book-body { 55 | color: #bdcadb; 56 | background: #1c1f2b; 57 | } 58 | .book.color-theme-2 .book-body .page-wrapper .page-inner section { 59 | background: #1c1f2b; 60 | } 61 | .book.font-size-0 .book-body .page-inner section { 62 | font-size: 1.2rem; 63 | } 64 | .book.font-size-1 .book-body .page-inner section { 65 | font-size: 1.4rem; 66 | } 67 | .book.font-size-2 .book-body .page-inner section { 68 | font-size: 1.6rem; 69 | } 70 | .book.font-size-3 .book-body .page-inner section { 71 | font-size: 2.2rem; 72 | } 73 | .book.font-size-4 .book-body .page-inner section { 74 | font-size: 4rem; 75 | } 76 | .book.font-family-0 { 77 | font-family: Georgia, serif; 78 | } 79 | .book.font-family-1 { 80 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 81 | } 82 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { 83 | color: #704214; 84 | } 85 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { 86 | color: inherit; 87 | } 88 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 89 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2, 90 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3, 91 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4, 92 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5, 93 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 94 | color: inherit; 95 | } 96 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 97 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { 98 | border-color: inherit; 99 | } 100 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 101 | color: inherit; 102 | } 103 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { 104 | background-color: inherit; 105 | } 106 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { 107 | border-color: inherit; 108 | } 109 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, 110 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { 111 | background: #fdf6e3; 112 | color: #657b83; 113 | border-color: #f8df9c; 114 | } 115 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { 116 | background-color: inherit; 117 | } 118 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th, 119 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td { 120 | border-color: #f5d06c; 121 | } 122 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { 123 | color: inherit; 124 | background-color: #fdf6e3; 125 | border-color: #444444; 126 | } 127 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 128 | background-color: #fbeecb; 129 | } 130 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { 131 | color: #bdcadb; 132 | } 133 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { 134 | color: #3eb1d0; 135 | } 136 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 137 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, 138 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, 139 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4, 140 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, 141 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 142 | color: #fffffa; 143 | } 144 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 145 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { 146 | border-color: #373b4e; 147 | } 148 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 149 | color: #373b4e; 150 | } 151 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { 152 | background-color: #373b4e; 153 | } 154 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote { 155 | border-color: #373b4e; 156 | } 157 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, 158 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { 159 | color: #9dbed8; 160 | background: #2d3143; 161 | border-color: #2d3143; 162 | } 163 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { 164 | background-color: #282a39; 165 | } 166 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th, 167 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td { 168 | border-color: #3b3f54; 169 | } 170 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { 171 | color: #b6c2d2; 172 | background-color: #2d3143; 173 | border-color: #3b3f54; 174 | } 175 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 176 | background-color: #35394b; 177 | } 178 | .book.color-theme-1 .book-header { 179 | color: #afa790; 180 | background: transparent; 181 | } 182 | .book.color-theme-1 .book-header .btn { 183 | color: #afa790; 184 | } 185 | .book.color-theme-1 .book-header .btn:hover { 186 | color: #73553c; 187 | background: none; 188 | } 189 | .book.color-theme-1 .book-header h1 { 190 | color: #704214; 191 | } 192 | .book.color-theme-2 .book-header { 193 | color: #7e888b; 194 | background: transparent; 195 | } 196 | .book.color-theme-2 .book-header .btn { 197 | color: #3b3f54; 198 | } 199 | .book.color-theme-2 .book-header .btn:hover { 200 | color: #fffff5; 201 | background: none; 202 | } 203 | .book.color-theme-2 .book-header h1 { 204 | color: #bdcadb; 205 | } 206 | .book.color-theme-1 .book-body .navigation { 207 | color: #afa790; 208 | } 209 | .book.color-theme-1 .book-body .navigation:hover { 210 | color: #73553c; 211 | } 212 | .book.color-theme-2 .book-body .navigation { 213 | color: #383f52; 214 | } 215 | .book.color-theme-2 .book-body .navigation:hover { 216 | color: #fffff5; 217 | } 218 | /* 219 | * Theme 1 220 | */ 221 | .book.color-theme-1 .book-summary { 222 | color: #afa790; 223 | background: #111111; 224 | border-right: 1px solid rgba(0, 0, 0, 0.07); 225 | } 226 | .book.color-theme-1 .book-summary .book-search { 227 | background: transparent; 228 | } 229 | .book.color-theme-1 .book-summary .book-search input, 230 | .book.color-theme-1 .book-summary .book-search input:focus { 231 | border: 1px solid transparent; 232 | } 233 | .book.color-theme-1 .book-summary ul.summary li.divider { 234 | background: #7e888b; 235 | box-shadow: none; 236 | } 237 | .book.color-theme-1 .book-summary ul.summary li i.fa-check { 238 | color: #33cc33; 239 | } 240 | .book.color-theme-1 .book-summary ul.summary li.done > a { 241 | color: #877f6a; 242 | } 243 | .book.color-theme-1 .book-summary ul.summary li a, 244 | .book.color-theme-1 .book-summary ul.summary li span { 245 | color: #877f6a; 246 | background: transparent; 247 | font-weight: normal; 248 | } 249 | .book.color-theme-1 .book-summary ul.summary li.active > a, 250 | .book.color-theme-1 .book-summary ul.summary li a:hover { 251 | color: #704214; 252 | background: transparent; 253 | font-weight: normal; 254 | } 255 | /* 256 | * Theme 2 257 | */ 258 | .book.color-theme-2 .book-summary { 259 | color: #bcc1d2; 260 | background: #2d3143; 261 | border-right: none; 262 | } 263 | .book.color-theme-2 .book-summary .book-search { 264 | background: transparent; 265 | } 266 | .book.color-theme-2 .book-summary .book-search input, 267 | .book.color-theme-2 .book-summary .book-search input:focus { 268 | border: 1px solid transparent; 269 | } 270 | .book.color-theme-2 .book-summary ul.summary li.divider { 271 | background: #272a3a; 272 | box-shadow: none; 273 | } 274 | .book.color-theme-2 .book-summary ul.summary li i.fa-check { 275 | color: #33cc33; 276 | } 277 | .book.color-theme-2 .book-summary ul.summary li.done > a { 278 | color: #62687f; 279 | } 280 | .book.color-theme-2 .book-summary ul.summary li a, 281 | .book.color-theme-2 .book-summary ul.summary li span { 282 | color: #c1c6d7; 283 | background: transparent; 284 | font-weight: 600; 285 | } 286 | .book.color-theme-2 .book-summary ul.summary li.active > a, 287 | .book.color-theme-2 .book-summary ul.summary li a:hover { 288 | color: #f4f4f5; 289 | background: #252737; 290 | font-weight: 600; 291 | } 292 | -------------------------------------------------------------------------------- /_book/gitbook/plugins/gitbook-plugin-highlight/ebook.css: -------------------------------------------------------------------------------- 1 | pre, 2 | code { 3 | /* http://jmblog.github.io/color-themes-for-highlightjs */ 4 | /* Tomorrow Comment */ 5 | /* Tomorrow Red */ 6 | /* Tomorrow Orange */ 7 | /* Tomorrow Yellow */ 8 | /* Tomorrow Green */ 9 | /* Tomorrow Aqua */ 10 | /* Tomorrow Blue */ 11 | /* Tomorrow Purple */ 12 | } 13 | pre .hljs-comment, 14 | code .hljs-comment, 15 | pre .hljs-title, 16 | code .hljs-title { 17 | color: #8e908c; 18 | } 19 | pre .hljs-variable, 20 | code .hljs-variable, 21 | pre .hljs-attribute, 22 | code .hljs-attribute, 23 | pre .hljs-tag, 24 | code .hljs-tag, 25 | pre .hljs-regexp, 26 | code .hljs-regexp, 27 | pre .ruby .hljs-constant, 28 | code .ruby .hljs-constant, 29 | pre .xml .hljs-tag .hljs-title, 30 | code .xml .hljs-tag .hljs-title, 31 | pre .xml .hljs-pi, 32 | code .xml .hljs-pi, 33 | pre .xml .hljs-doctype, 34 | code .xml .hljs-doctype, 35 | pre .html .hljs-doctype, 36 | code .html .hljs-doctype, 37 | pre .css .hljs-id, 38 | code .css .hljs-id, 39 | pre .css .hljs-class, 40 | code .css .hljs-class, 41 | pre .css .hljs-pseudo, 42 | code .css .hljs-pseudo { 43 | color: #c82829; 44 | } 45 | pre .hljs-number, 46 | code .hljs-number, 47 | pre .hljs-preprocessor, 48 | code .hljs-preprocessor, 49 | pre .hljs-pragma, 50 | code .hljs-pragma, 51 | pre .hljs-built_in, 52 | code .hljs-built_in, 53 | pre .hljs-literal, 54 | code .hljs-literal, 55 | pre .hljs-params, 56 | code .hljs-params, 57 | pre .hljs-constant, 58 | code .hljs-constant { 59 | color: #f5871f; 60 | } 61 | pre .ruby .hljs-class .hljs-title, 62 | code .ruby .hljs-class .hljs-title, 63 | pre .css .hljs-rules .hljs-attribute, 64 | code .css .hljs-rules .hljs-attribute { 65 | color: #eab700; 66 | } 67 | pre .hljs-string, 68 | code .hljs-string, 69 | pre .hljs-value, 70 | code .hljs-value, 71 | pre .hljs-inheritance, 72 | code .hljs-inheritance, 73 | pre .hljs-header, 74 | code .hljs-header, 75 | pre .ruby .hljs-symbol, 76 | code .ruby .hljs-symbol, 77 | pre .xml .hljs-cdata, 78 | code .xml .hljs-cdata { 79 | color: #718c00; 80 | } 81 | pre .css .hljs-hexcolor, 82 | code .css .hljs-hexcolor { 83 | color: #3e999f; 84 | } 85 | pre .hljs-function, 86 | code .hljs-function, 87 | pre .python .hljs-decorator, 88 | code .python .hljs-decorator, 89 | pre .python .hljs-title, 90 | code .python .hljs-title, 91 | pre .ruby .hljs-function .hljs-title, 92 | code .ruby .hljs-function .hljs-title, 93 | pre .ruby .hljs-title .hljs-keyword, 94 | code .ruby .hljs-title .hljs-keyword, 95 | pre .perl .hljs-sub, 96 | code .perl .hljs-sub, 97 | pre .javascript .hljs-title, 98 | code .javascript .hljs-title, 99 | pre .coffeescript .hljs-title, 100 | code .coffeescript .hljs-title { 101 | color: #4271ae; 102 | } 103 | pre .hljs-keyword, 104 | code .hljs-keyword, 105 | pre .javascript .hljs-function, 106 | code .javascript .hljs-function { 107 | color: #8959a8; 108 | } 109 | pre .hljs, 110 | code .hljs { 111 | display: block; 112 | background: white; 113 | color: #4d4d4c; 114 | padding: 0.5em; 115 | } 116 | pre .coffeescript .javascript, 117 | code .coffeescript .javascript, 118 | pre .javascript .xml, 119 | code .javascript .xml, 120 | pre .tex .hljs-formula, 121 | code .tex .hljs-formula, 122 | pre .xml .javascript, 123 | code .xml .javascript, 124 | pre .xml .vbscript, 125 | code .xml .vbscript, 126 | pre .xml .css, 127 | code .xml .css, 128 | pre .xml .hljs-cdata, 129 | code .xml .hljs-cdata { 130 | opacity: 0.5; 131 | } 132 | -------------------------------------------------------------------------------- /_book/gitbook/plugins/gitbook-plugin-search/lunr.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12 3 | * Copyright (C) 2015 Oliver Nightingale 4 | * MIT Licensed 5 | * @license 6 | */ 7 | !function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.12",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(t){return arguments.length&&null!=t&&void 0!=t?Array.isArray(t)?t.map(function(t){return t.toLowerCase()}):t.toString().trim().toLowerCase().split(/[\s\-]+/):[]},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,o=0;n>o;o++){for(var r=t[o],s=0;i>s&&(r=this._stack[s](r,o,t),void 0!==r);s++);void 0!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(en.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return o;t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o]}return r===t?o:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,o=e+Math.floor(i/2),r=this.elements[o];i>1;)t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o];return r>t?o:t>r?o+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,o=0,r=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>r-1||o>s-1)break;a[i]!==h[o]?a[i]h[o]&&o++:(n.add(a[i]),i++,o++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;return this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone(),i.add.apply(i,n.toArray()),i},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var i={},o=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));i[n.name]=r,t.SortedSet.prototype.add.apply(o,r)},this),this.documentStore.set(r,o),t.SortedSet.prototype.add.apply(this.corpusTokens,o.toArray());for(var s=0;s0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),i=new t.Vector,o=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,h=this,l=this.tokenStore.expand(e).reduce(function(n,o){var r=h.corpusTokens.indexOf(o),s=h.idf(o),l=1,u=new t.SortedSet;if(o!==e){var c=Math.max(3,o.length-e.length);l=1/Math.log(c)}return r>-1&&i.insert(r,a*s*l),Object.keys(h.tokenStore.get(o)).forEach(function(t){u.add(t)}),n.union(u)},new t.SortedSet);o.push(l)},this);var a=o.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,o=new t.Vector,r=0;i>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);o.insert(this.corpusTokens.indexOf(s),a*h)}return o},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,a="^("+o+")?"+r+o+"("+r+")?$",h="^("+o+")?"+r+o+r+o,l="^("+o+")?"+i,u=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,g=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+o+i+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,_=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,F=/^(.+?)(s|t)(ion)$/,O=/^(.+?)e$/,P=/ll$/,N=new RegExp("^"+o+i+"[^aeiouwxy]$"),T=function(n){var i,o,r,s,a,h,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=y,s.test(n)){var T=s.exec(n);s=u,s.test(T[1])&&(s=g,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,l=x,a.test(n)?n+="e":h.test(n)?(s=g,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=k,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+t[o])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+e[o])}if(s=_,a=F,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=O,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=N,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=P,a=c,s.test(n)&&a.test(n)&&(s=g,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.stopWordFilter=function(e){return e&&t.stopWordFilter.stopWords[e]!==e?e:void 0},t.stopWordFilter.stopWords={a:"a",able:"able",about:"about",across:"across",after:"after",all:"all",almost:"almost",also:"also",am:"am",among:"among",an:"an",and:"and",any:"any",are:"are",as:"as",at:"at",be:"be",because:"because",been:"been",but:"but",by:"by",can:"can",cannot:"cannot",could:"could",dear:"dear",did:"did","do":"do",does:"does",either:"either","else":"else",ever:"ever",every:"every","for":"for",from:"from",get:"get",got:"got",had:"had",has:"has",have:"have",he:"he",her:"her",hers:"hers",him:"him",his:"his",how:"how",however:"however",i:"i","if":"if","in":"in",into:"into",is:"is",it:"it",its:"its",just:"just",least:"least",let:"let",like:"like",likely:"likely",may:"may",me:"me",might:"might",most:"most",must:"must",my:"my",neither:"neither",no:"no",nor:"nor",not:"not",of:"of",off:"off",often:"often",on:"on",only:"only",or:"or",other:"other",our:"our",own:"own",rather:"rather",said:"said",say:"say",says:"says",she:"she",should:"should",since:"since",so:"so",some:"some",than:"than",that:"that",the:"the",their:"their",them:"them",then:"then",there:"there",these:"these",they:"they","this":"this",tis:"tis",to:"to",too:"too",twas:"twas",us:"us",wants:"wants",was:"was",we:"we",were:"were",what:"what",when:"when",where:"where",which:"which","while":"while",who:"who",whom:"whom",why:"why",will:"will","with":"with",would:"would",yet:"yet",you:"you",your:"your"},t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){var e=t.replace(/^\W+/,"").replace(/\W+$/,"");return""===e?void 0:e},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t[0],o=t.slice(1);return i in n||(n[i]={docs:{}}),0===o.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(o,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n', { 41 | 'class': 'book-search', 42 | 'role': 'search' 43 | }); 44 | 45 | $searchInput = $('', { 46 | 'type': 'text', 47 | 'class': 'form-control', 48 | 'val': value, 49 | 'placeholder': 'Type to search' 50 | }); 51 | 52 | $searchInput.appendTo($searchForm); 53 | $searchForm.prependTo(gitbook.state.$book.find('.book-summary')); 54 | } 55 | 56 | // Return true if search is open 57 | function isSearchOpen() { 58 | return gitbook.state.$book.hasClass("with-search"); 59 | } 60 | 61 | // Toggle the search 62 | function toggleSearch(_state) { 63 | if (isSearchOpen() === _state) return; 64 | 65 | gitbook.state.$book.toggleClass("with-search", _state); 66 | 67 | // If search bar is open: focus input 68 | if (isSearchOpen()) { 69 | gitbook.sidebar.toggle(true); 70 | $searchInput.focus(); 71 | } else { 72 | $searchInput.blur(); 73 | $searchInput.val(""); 74 | gitbook.sidebar.filter(null); 75 | } 76 | } 77 | 78 | // Recover current search when page changed 79 | function recoverSearch() { 80 | var keyword = gitbook.storage.get("keyword", ""); 81 | 82 | createForm(keyword); 83 | 84 | if (keyword.length > 0) { 85 | if(!isSearchOpen()) { 86 | toggleSearch(); 87 | } 88 | gitbook.sidebar.filter(_.pluck(search(keyword), "path")); 89 | } 90 | }; 91 | 92 | 93 | gitbook.events.bind("start", function(config) { 94 | // Pre-fetch search index and create the form 95 | fetchIndex(); 96 | createForm(); 97 | 98 | // Type in search bar 99 | $(document).on("keyup", ".book-search input", function(e) { 100 | var key = (e.keyCode ? e.keyCode : e.which); 101 | var q = $(this).val(); 102 | 103 | if (key == 27) { 104 | e.preventDefault(); 105 | toggleSearch(false); 106 | return; 107 | } 108 | if (q.length == 0) { 109 | gitbook.sidebar.filter(null); 110 | gitbook.storage.remove("keyword"); 111 | } else { 112 | var results = search(q); 113 | gitbook.sidebar.filter( 114 | _.pluck(results, "path") 115 | ); 116 | gitbook.storage.set("keyword", q); 117 | } 118 | }); 119 | 120 | // Create the toggle search button 121 | gitbook.toolbar.createButton({ 122 | icon: 'fa fa-search', 123 | label: 'Search', 124 | position: 'left', 125 | onClick: toggleSearch 126 | }); 127 | 128 | // Bind keyboard to toggle search 129 | gitbook.keyboard.bind(['f'], toggleSearch) 130 | }); 131 | 132 | gitbook.events.bind("page.change", recoverSearch); 133 | }); 134 | 135 | 136 | -------------------------------------------------------------------------------- /_book/gitbook/plugins/gitbook-plugin-sharing/buttons.js: -------------------------------------------------------------------------------- 1 | require(["gitbook", "lodash"], function(gitbook, _) { 2 | var SITES = { 3 | 'facebook': { 4 | 'label': 'Facebook', 5 | 'icon': 'fa fa-facebook', 6 | 'onClick': function(e) { 7 | e.preventDefault(); 8 | window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(location.href)); 9 | } 10 | }, 11 | 'twitter': { 12 | 'label': 'Twitter', 13 | 'icon': 'fa fa-twitter', 14 | 'onClick': function(e) { 15 | e.preventDefault(); 16 | window.open("http://twitter.com/home?status="+encodeURIComponent(document.title+" "+location.href)); 17 | } 18 | }, 19 | 'google': { 20 | 'label': 'Google+', 21 | 'icon': 'fa fa-google-plus', 22 | 'onClick': function(e) { 23 | e.preventDefault(); 24 | window.open("https://plus.google.com/share?url="+encodeURIComponent(location.href)); 25 | } 26 | }, 27 | 'weibo': { 28 | 'label': 'Weibo', 29 | 'icon': 'fa fa-weibo', 30 | 'onClick': function(e) { 31 | e.preventDefault(); 32 | window.open("http://service.weibo.com/share/share.php?content=utf-8&url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title)); 33 | } 34 | }, 35 | 'instapaper': { 36 | 'label': 'Instapaper', 37 | 'icon': 'fa fa-instapaper', 38 | 'onClick': function(e) { 39 | e.preventDefault(); 40 | window.open("http://www.instapaper.com/text?u="+encodeURIComponent(location.href)); 41 | } 42 | }, 43 | 'vk': { 44 | 'label': 'VK', 45 | 'icon': 'fa fa-vk', 46 | 'onClick': function(e) { 47 | e.preventDefault(); 48 | window.open("http://vkontakte.ru/share.php?url="+encodeURIComponent(location.href)); 49 | } 50 | } 51 | }; 52 | 53 | 54 | 55 | gitbook.events.bind("start", function(e, config) { 56 | var opts = config.sharing; 57 | 58 | // Create dropdown menu 59 | var menu = _.chain(opts.all) 60 | .map(function(id) { 61 | var site = SITES[id]; 62 | 63 | return { 64 | text: site.label, 65 | onClick: site.onClick 66 | }; 67 | }) 68 | .compact() 69 | .value(); 70 | 71 | // Create main button with dropdown 72 | if (menu.length > 0) { 73 | gitbook.toolbar.createButton({ 74 | icon: 'fa fa-share-alt', 75 | label: 'Share', 76 | position: 'right', 77 | dropdown: [menu] 78 | }); 79 | } 80 | 81 | // Direct actions to share 82 | _.each(SITES, function(site, sideId) { 83 | if (!opts[sideId]) return; 84 | 85 | gitbook.toolbar.createButton({ 86 | icon: site.icon, 87 | label: site.text, 88 | position: 'right', 89 | onClick: site.onClick 90 | }); 91 | }); 92 | }); 93 | }); 94 | -------------------------------------------------------------------------------- /_book/imgs/1.1.1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-1.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-2.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-3.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-4.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-5.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-6.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-7.png -------------------------------------------------------------------------------- /_book/imgs/1.1.1-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.1-8.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-0.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-1.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-2.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-3.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-4.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-5.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-6.png -------------------------------------------------------------------------------- /_book/imgs/1.1.2-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.1.2-7.png -------------------------------------------------------------------------------- /_book/imgs/1.2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-1.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-10.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-11.png -------------------------------------------------------------------------------- /_book/imgs/1.2-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-12.png -------------------------------------------------------------------------------- /_book/imgs/1.2-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-13.png -------------------------------------------------------------------------------- /_book/imgs/1.2-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-2.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-3.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-4.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-5.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-6.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-7.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-8.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2-9.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2.1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-1.png -------------------------------------------------------------------------------- /_book/imgs/1.2.1-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-2.jpg -------------------------------------------------------------------------------- /_book/imgs/1.2.1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-3.png -------------------------------------------------------------------------------- /_book/imgs/1.2.1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-4.png -------------------------------------------------------------------------------- /_book/imgs/1.2.1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-5.png -------------------------------------------------------------------------------- /_book/imgs/1.2.1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-6.png -------------------------------------------------------------------------------- /_book/imgs/1.2.1-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-7.png -------------------------------------------------------------------------------- /_book/imgs/1.2.1-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.1-8.png -------------------------------------------------------------------------------- /_book/imgs/1.2.2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.2-1.png -------------------------------------------------------------------------------- /_book/imgs/1.2.2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.2-2.png -------------------------------------------------------------------------------- /_book/imgs/1.2.2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.2-3.png -------------------------------------------------------------------------------- /_book/imgs/1.2.2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/1.2.2-4.png -------------------------------------------------------------------------------- /_book/imgs/2.1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/2.1-1.png -------------------------------------------------------------------------------- /_book/imgs/2.1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/2.1-2.png -------------------------------------------------------------------------------- /_book/imgs/2.1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/2.1-3.png -------------------------------------------------------------------------------- /_book/imgs/2.1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/2.1-4.png -------------------------------------------------------------------------------- /_book/imgs/2.1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/2.1-5.png -------------------------------------------------------------------------------- /_book/imgs/2.2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/2.2-1.jpg -------------------------------------------------------------------------------- /_book/imgs/Pi3-differences_700.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/Pi3-differences_700.jpg -------------------------------------------------------------------------------- /_book/imgs/Pi3B-underside_700.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/Pi3B-underside_700.jpg -------------------------------------------------------------------------------- /_book/imgs/README.md: -------------------------------------------------------------------------------- 1 | # 简介 2 | -------------------------------------------------------------------------------- /_book/imgs/SUMMARY.md: -------------------------------------------------------------------------------- 1 | * [微控制器](1/1-0.md) 2 | * [树莓派](1/1-1/1-1-0.md) 3 | * [树莓派硬件系统](1/1-1/1-1-1.md) 4 | * [树莓派软件系统](1/1-1/1-1-2.md) 5 | * [Arduino](1/1-2/1-2-0.md) 6 | * [Arduino UNO硬件介绍](1/1-2/1-2-1.md) 7 | * [点亮LED](1/1-2/1-2-2.md) 8 | * [ARM]() 9 | * [单片机]() 10 | * [硬件编程](2/2-0.md) 11 | * [选用何种语言](2/2-1.md) 12 | * [Arduino液晶显示](2/2-2.md) -------------------------------------------------------------------------------- /_book/imgs/gpio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/gpio.png -------------------------------------------------------------------------------- /_book/imgs/osc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/osc.png -------------------------------------------------------------------------------- /_book/imgs/pwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/pwm.png -------------------------------------------------------------------------------- /_book/imgs/rasp0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/rasp0.png -------------------------------------------------------------------------------- /_book/imgs/rasp1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/rasp1.png -------------------------------------------------------------------------------- /_book/imgs/sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/sd.png -------------------------------------------------------------------------------- /_book/imgs/sysPower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/sysPower.png -------------------------------------------------------------------------------- /_book/imgs/usbPower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/_book/imgs/usbPower.png -------------------------------------------------------------------------------- /_book/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Introduction | 简介 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
56 | 57 | 58 |
59 | 283 |
284 | 285 |
286 |
287 | 297 | 298 |
299 |
300 | 301 | 302 |
303 | 304 |

简介

305 |

项目进行中,问题可提至issue

306 | 307 | 308 |
309 | 310 | 311 |
312 |
313 |
314 | 315 | 316 | 317 | 318 | 319 |
320 |
321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 347 | 348 | 349 | 350 | 351 | 352 | -------------------------------------------------------------------------------- /imgs/1.1.1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-1.png -------------------------------------------------------------------------------- /imgs/1.1.1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-2.png -------------------------------------------------------------------------------- /imgs/1.1.1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-3.png -------------------------------------------------------------------------------- /imgs/1.1.1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-4.png -------------------------------------------------------------------------------- /imgs/1.1.1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-5.png -------------------------------------------------------------------------------- /imgs/1.1.1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-6.png -------------------------------------------------------------------------------- /imgs/1.1.1-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-7.png -------------------------------------------------------------------------------- /imgs/1.1.1-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.1-8.png -------------------------------------------------------------------------------- /imgs/1.1.2-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-0.png -------------------------------------------------------------------------------- /imgs/1.1.2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-1.png -------------------------------------------------------------------------------- /imgs/1.1.2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-2.png -------------------------------------------------------------------------------- /imgs/1.1.2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-3.png -------------------------------------------------------------------------------- /imgs/1.1.2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-4.png -------------------------------------------------------------------------------- /imgs/1.1.2-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-5.png -------------------------------------------------------------------------------- /imgs/1.1.2-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-6.png -------------------------------------------------------------------------------- /imgs/1.1.2-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.1.2-7.png -------------------------------------------------------------------------------- /imgs/1.2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-1.jpg -------------------------------------------------------------------------------- /imgs/1.2-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-10.jpg -------------------------------------------------------------------------------- /imgs/1.2-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-11.png -------------------------------------------------------------------------------- /imgs/1.2-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-12.png -------------------------------------------------------------------------------- /imgs/1.2-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-13.png -------------------------------------------------------------------------------- /imgs/1.2-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-2.jpg -------------------------------------------------------------------------------- /imgs/1.2-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-3.jpg -------------------------------------------------------------------------------- /imgs/1.2-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-4.jpg -------------------------------------------------------------------------------- /imgs/1.2-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-5.jpg -------------------------------------------------------------------------------- /imgs/1.2-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-6.jpg -------------------------------------------------------------------------------- /imgs/1.2-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-7.jpg -------------------------------------------------------------------------------- /imgs/1.2-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-8.jpg -------------------------------------------------------------------------------- /imgs/1.2-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2-9.jpg -------------------------------------------------------------------------------- /imgs/1.2.1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-1.png -------------------------------------------------------------------------------- /imgs/1.2.1-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-2.jpg -------------------------------------------------------------------------------- /imgs/1.2.1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-3.png -------------------------------------------------------------------------------- /imgs/1.2.1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-4.png -------------------------------------------------------------------------------- /imgs/1.2.1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-5.png -------------------------------------------------------------------------------- /imgs/1.2.1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-6.png -------------------------------------------------------------------------------- /imgs/1.2.1-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-7.png -------------------------------------------------------------------------------- /imgs/1.2.1-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.1-8.png -------------------------------------------------------------------------------- /imgs/1.2.2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.2-1.png -------------------------------------------------------------------------------- /imgs/1.2.2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.2-2.png -------------------------------------------------------------------------------- /imgs/1.2.2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.2-3.png -------------------------------------------------------------------------------- /imgs/1.2.2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/1.2.2-4.png -------------------------------------------------------------------------------- /imgs/2.1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/2.1-1.png -------------------------------------------------------------------------------- /imgs/2.1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/2.1-2.png -------------------------------------------------------------------------------- /imgs/2.1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/2.1-3.png -------------------------------------------------------------------------------- /imgs/2.1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/2.1-4.png -------------------------------------------------------------------------------- /imgs/2.1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/2.1-5.png -------------------------------------------------------------------------------- /imgs/2.2-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/2.2-1.jpg -------------------------------------------------------------------------------- /imgs/Pi3-differences_700.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/Pi3-differences_700.jpg -------------------------------------------------------------------------------- /imgs/Pi3B-underside_700.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/Pi3B-underside_700.jpg -------------------------------------------------------------------------------- /imgs/README.md: -------------------------------------------------------------------------------- 1 | # 简介 2 | -------------------------------------------------------------------------------- /imgs/SUMMARY.md: -------------------------------------------------------------------------------- 1 | * [微控制器](1/1-0.md) 2 | * [树莓派](1/1-1/1-1-0.md) 3 | * [树莓派硬件系统](1/1-1/1-1-1.md) 4 | * [树莓派软件系统](1/1-1/1-1-2.md) 5 | * [Arduino](1/1-2/1-2-0.md) 6 | * [Arduino UNO硬件介绍](1/1-2/1-2-1.md) 7 | * [点亮LED](1/1-2/1-2-2.md) 8 | * [ARM]() 9 | * [单片机]() 10 | * [硬件编程](2/2-0.md) 11 | * [选用何种语言](2/2-1.md) 12 | * [Arduino液晶显示](2/2-2.md) -------------------------------------------------------------------------------- /imgs/gpio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/gpio.png -------------------------------------------------------------------------------- /imgs/osc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/osc.png -------------------------------------------------------------------------------- /imgs/pwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/pwm.png -------------------------------------------------------------------------------- /imgs/rasp0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/rasp0.png -------------------------------------------------------------------------------- /imgs/rasp1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/rasp1.png -------------------------------------------------------------------------------- /imgs/sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/sd.png -------------------------------------------------------------------------------- /imgs/sysPower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/sysPower.png -------------------------------------------------------------------------------- /imgs/usbPower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sundway/iot/c6b158dd55b70a8094fd0c9d444270b87e11b2ca/imgs/usbPower.png --------------------------------------------------------------------------------