Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
junhuanchen committed Aug 26, 2019
0 parents commit a013e50
Show file tree
Hide file tree
Showing 1,224 changed files with 37,104 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
source/_build
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"search.usePCRE2": true,
"restructuredtext.confPath": ""
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Open Source STEAM

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
Binary file added micropython.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#      BPI-STEAM/Docs 基础手册(自由编辑)

[![Open Source Love](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badge/)

[![Documentation Status](https://readthedocs.org/projects/bpi-steam-docs/badge/?version=latest)](https://bpi-steam-docs.readthedocs.io/zh_CN/latest/?badge=latest)

## how to edit

The document content is in [source](https://github.com/BPI-STEAM/Docs/tree/master/source).

文档结构如下:(如果你需要操作,请扫一遍关键目录,可以用 markdown 也可以用 rst,看自己喜欢)

- [source](https://github.com/BPI-STEAM/Docs/tree/master/source)
- [source/bpi-dev](https://github.com/BPI-STEAM/Docs/tree/master/source/bpi-dev) 工具类、归档类、目录类相关。
- [source/bpi-mpy](https://github.com/BPI-STEAM/Docs/tree/master/source/bpi-mpy) micropython 教程相关。
- [source/bpi-web](https://github.com/BPI-STEAM/Docs/tree/master/source/bpi-web) webduino 教程相关。
- [source/bpi-steam](https://github.com/BPI-STEAM/Docs/tree/master/source/bpi-steam) bpi-bit 产品、介绍相关。
- mPython/docs 引用掌控板的公共文档。
- micropython/docs 引用官方英文的公共文档。
- conf.py 自动化部署脚本,不需要修改
- contents.rst 和 index.rst 为 根目录(进入网站左边一排),需保持一致。

如果想提交内容,直接提交即可,提交后,项目会自动编译部署到网站,而你只需要在本地 build 核对一下即可,如果出现问题请提交 issue 或直接反馈到群里。

### micropytho list

![](micropython.png)

## related and thank them

感谢以下文档提供的公共部分内容,我将保留引用信息链接。

[esp32 中文](https://docs.singtown.com/micropython/zh/latest/esp32/index.html)

[openmv 中文](https://docs.singtown.com/micropython/zh/latest/openmvcam/index.html)

[microbit 中文](http://www.qingchuangzhiyi.com/doc/tutorials/hello.html)

[micropython 官方](http://docs.micropython.org/en/latest/esp32/quickref.html)

[mPython中文](https://mPython.readthedocs.io/zh/master/)

## python

```unix
pip install sphinx, sphinx_rtd_theme, recommonmark
```

## powershell

```bat
.\make.bat html
```

## git (Do not handle)

```unix
git submodule add https://github.com/micropython/micropython
git submodule add https://github.com/labplus-cn/mPython
git submodule update --init --recursive
```
Binary file added source/_static/bit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/editor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/footer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions source/arduino/advanced/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
进阶开发
========================================

从这里开始,就正式进入使用 PlatformIO 的开发环节了,请按下述教程开始你的进阶之旅吧。

.. toctree::
:maxdepth: 1
:numbered:

setting
14 changes: 14 additions & 0 deletions source/arduino/modules/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
第三方库
========================================

.. Hint::

第三方 Arduino 代码可能会出现接口缺失,但一般都有备用接口可以替代使用,出现错误无需紧张,根据接口类型对应处理和修复即可。

在这里你将体验到 Arduino 的额外丰富的库代码,更多第三方的功能模块可以在各大开源社区中获得,但在这里出现的都是经过验证的。

.. toctree::
:maxdepth: 1
:numbered:

basic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/home01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/home06.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/home08.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/logo.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/win-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/win-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/win-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/win-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/arduino/tutorials/basic/Image/win-5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions source/arduino/tutorials/basic/arduino-ide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# 安装Arduino IDE并添加BPI-BIT开发扩展

## 安装Arduino IDE:

### 在Windows系统下:
1. 下载并安装最新版本的Arduino IDE, ```Windows Installer``` from [arduino.cc](https://www.arduino.cc/en/Main/Software)
2.[espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)开源项目下载Arduino开发扩展包

![Step 1](./Image/win-1.png)

3. 解压Arduino开发扩展包 ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32```

- ARDUINO_SKETCHBOOK_DIR: 一般情况下是 ```C:/Users/[YOUR_USER_NAME]/Documents/Arduino``` 并列在Arduino首选项中的“Sketchbook位置”下方。

![Step 2](./Image/win-2.png)

- 依次打开目录 ```[ARDUINO_SKETCHBOOK_DIR]/hardware/espressif/esp32/tools``` 并且双击运行 ```get.exe```

![Step 3](./Image/win-3.png)

-```get.exe``` 运行结束, 您应该在目录中看到以下文件

![Step 4](./Image/win-4.png)

4. 插入BPI:BIT板并等待驱动程序安装(或手动安装) [Serial CH341](http://www.wch.cn/downloads/file/5.html)
5. 运行 `Arduino IDE`
6. 选择您的版型(BPI-BIT) ```Tools > Board``` menu

![Step 5](./Image/win-5.png)

7. 选择BIT板所连接的COM端口,例如`COMx`
8. 编译并上传您的工程代码 (BIT板设计有自动烧录电路,直接点击上传即可)

![Arduino IDE Example](./Image/arduino-ide.png)

### 在Debian / Ubuntu OS安装说明

-[arduino.cc](https://www.arduino.cc/en/Main/Software)网站获取并安装最新版本的 Arduino IDE
- 打开终端并执行以下命令 (copy-> paste并点击回车):

```bash
sudo usermod -a -G dialout $USER && \
sudo apt-get install git && \
wget https://bootstrap.pypa.io/get-pip.py && \
sudo python get-pip.py && \
sudo pip install pyserial && \
mkdir -p ~/Arduino/hardware/espressif && \
cd ~/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32 && \
git submodule update --init --recursive && \
cd tools && \
python2 get.py
```
- 重新运行 Arduino IDE

- 如果您已经安装arduino至`~/`目录,请执行以下代码, 如果没有, 那么请从 `mkdir -p ~/Arduino/hardware`开始:

```bash
cd ~/Arduino/hardware
mkdir -p espressif && \
cd espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32 && \
git submodule update --init --recursive && \
cd tools && \
python2 get.py
```

### Mac OS安装说明

-[arduino.cc](https://www.arduino.cc/en/Main/Software)网站获取并安装最新版本的 Arduino IDE
- 打开终端并执行以下命令 (copy-> paste并点击回车):

```bash
mkdir -p ~/Documents/Arduino/hardware/espressif && \
cd ~/Documents/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32 && \
git submodule update --init --recursive && \
cd tools && \
python get.py
```
其中 `~/Documents/Arduino` 目录与"Arduino" > "首选项" > "Sketchbook location" (在软件启动后)应该保持一致。 如果有需要的话,或许需要更改上面的命令!

- 如果您收到以下错误。 使用xcode-select --install安装命令行开发工具并再次尝试上面的命令:

```xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun```

```xcode-select --install```

- 在运行 `python get.py`的时候,收到错误提示: `IOError: [Errno socket error] [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)` ,您可以尝试使用 `python3` 代替 `python`

- 重启 Arduino IDE
9 changes: 9 additions & 0 deletions source/arduino/tutorials/basic/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
使用Arduino IDE编程
========================================

.. toctree::
:maxdepth: 2
:numbered:

arduino-ide

10 changes: 10 additions & 0 deletions source/arduino/tutorials/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
使用基础
========================================

这里你将会体验和了解什么是 Arduino 编程,开始你的 C/C++ 嵌入式开发之旅吧。

.. toctree::
:maxdepth: 2

install
basic/index
58 changes: 58 additions & 0 deletions source/bpi-steam/driver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## 驱动安装

为什么需要安装驱动,根据百度百科定义,驱动程序一般指的是设备驱动程序(Device Driver),是一种可以使计算机和设备通信的特殊程序。相当于硬件的接口,操作系统只有通过这个接口,才能控制硬件设备的工作。

因此,若是有需要专业开发硬件的用户,可以参考本文进行电脑驱动的安装,没有这种需要的话,可以跳过本文。

### 连接板子

板子采用 CH340 / CH341 串口驱动芯片,可以轻松的在 Windows 、 Linux 、macOS 等系统下自动安装驱动。

> [CH341SER Win 系统驱动](http://www.wch.cn/downloads/file/5.html)
>
> [CH341SER 其他系统驱动](https://blog.csdn.net/jazzsoldier/article/details/70169732)
>
将板子通过 MicroUSB 线连接到你的电脑里,以下以 Windows 10 为例。

![](driver/connect.gif)

### 查看驱动

进入 **设备管理器** 确认串口驱动(Serial)是否安装,进入方法如下。

- (右键)此电脑 -> 属性 -> **设备管理器**
- 开始菜单 -> (输入)**设备管理器**
- 控制面板 -> (搜索)**设备管理器**

![](driver/error.png)

可以看到 设备显示 **USB2.0-Serial** ,说明**未安装驱动**,若此前已安装驱动,可以跳至步骤 5 。

### 安装驱动

点此获取 [Serial CH341](http://www.wch.cn/downloads/file/5.html) 驱动,并按如下说明操作安装驱动

打开下载的 **CH341SER.ZIP** 压缩包,进入 **CH341SER** 文件夹,打开 **SETUP.EXE**,即可看到如下图。

![](driver/install.png)

点击 **INSTALL** (安装),等待片刻即可完成安装。

### 确认串口

核对板子是否连接成功

![](driver/success.png)

可以看到原来的 **USB2.0-Serial** 消失了,取而代之的是 **USB-SERIAL CH340(COM3)**,这意味着你已经成功安装驱动,并且得到板子串口名称为(**COM3**),你可以通过各种串口工具来查看串口名(COM3)的板子传出的信息。

### 其他系统

#### macOS 安装

- [CH340 macOS 驱动使用教程](https://blog.csdn.net/jazzsoldier/article/details/70171771)

#### Linux 安装

- 官方 linux Kernel2.6 以后默认自带,也可在[此处下载](http://www.wch.cn/download/CH341SER_LINUX_ZIP.html)
Binary file added source/bpi-steam/driver/connect.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/bpi-steam/driver/error.png
Binary file added source/bpi-steam/driver/install.png
Binary file added source/bpi-steam/driver/success.png

0 comments on commit a013e50

Please sign in to comment.