Skip to content

Commit

Permalink
按键图形示例
Browse files Browse the repository at this point in the history
  • Loading branch information
LahmYing committed Jan 8, 2019
1 parent d1c3611 commit 6d17e80
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
48 changes: 48 additions & 0 deletions examples/button/touchPad.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="controls_repeat_forever" id="N59s5;A_yS%d)EmU9-}I" x="-382" y="34">
<statement name="DO">
<block type="controls_if" id="pjR_m,ZBH.-udHN9Ctb3">
<value name="IF0">
<block type="mpython_touchPad_value" id="@G+~$qAj$r1w2Y57q:05">
<field name="touchPad">P</field>
</block>
</value>
<statement name="DO0">
<block type="mpython_display_fill" id="(;6Skc[I@^[++alAgS;y">
<field name="display_fill">fill(0)</field>
<next>
<block type="mpython_display_DispChar" id="p6O)0z/?4/2h@v)4q(+a">
<value name="x">
<shadow type="math_number" id="lIHHTA;09,On01]T$l|l">
<field name="NUM">0</field>
</shadow>
</value>
<value name="y">
<shadow type="math_number" id="JgSj0Y@PxU!|cz+m%LXy">
<field name="NUM">0</field>
</shadow>
</value>
<value name="message">
<shadow type="text" id="UN23XQGyVW*9[,UR2{|?">
<field name="TEXT">Hello, World!</field>
</shadow>
<block type="text_join" id="9z(8GC#4|=;qcYZw@EK9">
<mutation items="1"></mutation>
<value name="ADD0">
<block type="mpython_touchPad_value_num" id="eU`T9!@ZR)W/VU}f}UgO">
<field name="touchPad">P</field>
</block>
</value>
</block>
</value>
<next>
<block type="mpython_display_Show" id="7VG}}4Z-1|kHTOy;ZZ1("></block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
29 changes: 29 additions & 0 deletions source/blocks/button.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
按键
======

按键控制类指令

button_[a,b].value()
-------------

**描述:** 获取 button_[a,b] 按键引脚状态

.. image:: /images/blocks/button/button.png
:scale: 90 %


touchPad_[P,Y,T,H,O,N].read()
-------------

**描述:** 返回触摸引脚 touchPad_P/Y/T/H/O/N 的值


示例
^^^^^

.. image:: /images/blocks/button/example/touchPad.png
:scale: 90 %

:download:`点击下载图形化示例</../examples/button/touchPad.xml>`


1 change: 1 addition & 0 deletions source/blocks/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:maxdepth: 1

oled.rst
button.rst
wifi.rst
pin.rst
music.rst
Expand Down
Binary file added source/images/blocks/button/button.png
Loading
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/images/blocks/button/example/touchPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6d17e80

Please sign in to comment.