-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,313 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,7 +174,7 @@ build web docs: | |
|
||
deploy production: | ||
stage: deploy | ||
image: ai.b-bug.org:5000/python:web-docs-v2 | ||
image: ai.b-bug.org:5000/huangziyi/deploy:v1 | ||
dependencies: | ||
- build web docs | ||
rules: | ||
|
@@ -186,7 +186,7 @@ deploy production: | |
url: https://developer.canaan-creative.com/k230_canmv/dev/index.html | ||
retry: 2 | ||
script: | ||
- scp -P 52522 -O -C -r _build/* [email protected]:/data/webapp/k230_canmv/ | ||
- scp -P $AWS_PORT -C -r _build/* $AWS/data/webapp/k230_canmv/ | ||
|
||
|
||
# sync dev branch to main branch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# K230 CanMV TOUCH 模块API手册 | ||
|
||
![cover](../images/canaan-cover.png) | ||
|
||
版权所有©2023北京嘉楠捷思信息技术有限公司 | ||
|
||
<div style="page-break-after:always"></div> | ||
|
||
## 免责声明 | ||
|
||
您购买的产品、服务或特性等应受北京嘉楠捷思信息技术有限公司(“本公司”,下同)及其关联公司的商业合同和条款的约束,本文档中描述的全部或部分产品、服务或特性可能不在您的购买或使用范围之内。除非合同另有约定,本公司不对本文档的任何陈述、信息、内容的正确性、可靠性、完整性、适销性、符合特定目的和不侵权提供任何明示或默示的声明或保证。除非另有约定,本文档仅作为使用指导参考。 | ||
|
||
由于产品版本升级或其他原因,本文档内容将可能在未经任何通知的情况下,不定期进行更新或修改。 | ||
|
||
## 商标声明 | ||
|
||
![logo](../images/logo.png)、“嘉楠”和其他嘉楠商标均为北京嘉楠捷思信息技术有限公司及其关联公司的商标。本文档可能提及的其他所有商标或注册商标,由各自的所有人拥有。 | ||
|
||
**版权所有 © 2023北京嘉楠捷思信息技术有限公司。保留一切权利。** | ||
非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。 | ||
|
||
<div style="page-break-after:always"></div> | ||
|
||
## 目录 | ||
|
||
[TOC] | ||
|
||
## 前言 | ||
|
||
### 概述 | ||
|
||
本文档主要介绍machine模块下的TOUCH类API。 | ||
|
||
### 读者对象 | ||
|
||
本文档(本指南)主要适用于以下人员: | ||
|
||
- 技术支持工程师 | ||
- 软件开发工程师 | ||
|
||
### 缩略词定义 | ||
|
||
| 简称 | 说明 | | ||
| ---- | ---- | | ||
| | | | ||
|
||
### 修订记录 | ||
|
||
| 文档版本号 | 修改说明 | 修改者 | 日期 | | ||
| ---------- | -------- | ---------- | ---------- | | ||
| V1.0 | 初版 | 软件部 | 2024-04-20 | | ||
|
||
## 1. 概述 | ||
|
||
触摸模块基于rtt的触摸框架,支持单点多点电容触摸屏、电阻触摸屏。 | ||
|
||
## 2. API描述 | ||
|
||
TOUCH类位于machine模块下 | ||
|
||
### 示例 | ||
|
||
```python | ||
from machine import TOUCH | ||
# 实例化TOUCH设备0 | ||
tp = TOUCH(0) | ||
# 获取TOUCH数据 | ||
p = tp.read() | ||
print(p) | ||
# print(p[0].x) | ||
# print(p[0].y) | ||
# print(p[0].event) | ||
``` | ||
|
||
### 构造函数 | ||
|
||
```python | ||
touch = TOUCH(index) | ||
``` | ||
|
||
【参数】 | ||
|
||
- index: TOUCH设备号,取值:[0,9],实际取决于有几个触摸设备 | ||
|
||
### read | ||
|
||
```python | ||
TOUCH.read([count]) | ||
``` | ||
|
||
获取触摸数据 | ||
|
||
【参数】 | ||
|
||
- count: 最多读取多少个触摸点,取值:[0:10],默认为0,读取全部触摸点 | ||
|
||
【返回值】 | ||
|
||
返回触摸点数据,类型为tuple,([tp[,tp...]]),每个tp都是一个touch_info类 | ||
|
||
### deinit | ||
|
||
```python | ||
TOUCH.deinit() | ||
``` | ||
|
||
释放TOUCH资源 | ||
|
||
【参数】 | ||
|
||
无 | ||
|
||
【返回值】 | ||
|
||
无 | ||
|
||
## 3. TOUCH_INFO 类 | ||
|
||
TOUCH_INFO类存储了触摸点的信息,用户可通过相关属性(只读)去访问 | ||
|
||
- event,事件码 | ||
- track_id,触点id,用于多点触摸 | ||
- width,触点width | ||
- x,触点x坐标 | ||
- y,触点y坐标 | ||
- timestamp,触点时间辍 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.