pxt-calliope/libs/core/blocks-test/pins.blocks

209 lines
11 KiB
Plaintext
Raw Normal View History

<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="pins_on_pulsed" x="-157" y="130">
2020-08-19 22:03:58 +02:00
<field name="pin">DigitalPin.C5</field>
<field name="pulse">PulseValue.Low</field>
<statement name="HANDLER">
<block type="device_set_analog_pin">
2020-08-19 22:03:58 +02:00
<field name="name">AnalogPin.C6</field>
<value name="value">
<shadow type="math_number">
<field name="NUM">5</field>
</shadow>
</value>
<next>
<block type="device_set_analog_period">
2020-08-19 22:03:58 +02:00
<field name="pin">AnalogPin.C6</field>
<value name="micros">
<shadow type="math_number">
<field name="NUM">20000</field>
</shadow>
</value>
<next>
<block type="device_set_digital_pin">
2020-08-19 22:03:58 +02:00
<field name="name">DigitalPin.C6</field>
<value name="value">
<shadow type="math_number">
<field name="NUM">5</field>
</shadow>
</value>
<next>
<block type="device_set_servo_pin">
2020-08-19 22:03:58 +02:00
<field name="name">AnalogPin.C5</field>
<value name="value">
<shadow type="math_number">
<field name="NUM">5</field>
</shadow>
</value>
<next>
<block type="device_set_servo_pulse">
2020-08-19 22:03:58 +02:00
<field name="value">AnalogPin.C6</field>
<value name="micros">
<shadow type="math_number" id="Hx4bpmg|8KSH=b_`+XtP">
<field name="NUM">1500</field>
</shadow>
<block type="math_map">
<value name="value">
<shadow type="math_number" id="J%8`=~h4-?O{fY59%(_{">
<field name="NUM">0</field>
</shadow>
<block type="pins_i2c_readnumber">
<field name="format">NumberFormat.Int8BE</field>
<value name="address">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<value name="repeat">
<shadow type="logic_boolean">
<field name="BOOL">FALSE</field>
</shadow>
</value>
</block>
</value>
<value name="fromLow">
<shadow type="math_number" id="kp(!mScnCVWI/1_X|ar#">
<field name="NUM">0</field>
</shadow>
<block type="pins_pulse_in">
2020-08-19 22:03:58 +02:00
<field name="name">DigitalPin.C9</field>
<field name="value">PulseValue.Low</field>
</block>
</value>
<value name="fromHigh">
<shadow type="math_number" id="]@F=`[ZuxAk,=05Yyn[{">
<field name="NUM">1023</field>
</shadow>
<block type="pins_pulse_duration"></block>
</value>
<value name="toLow">
<shadow type="math_number" id="sJDL?hoabUE)cDdBJWO=">
<field name="NUM">0</field>
</shadow>
<block type="spi_write">
<value name="value">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</value>
<value name="toHigh">
<shadow type="math_number">
<field name="NUM">4</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="i2c_writenumber">
<field name="format">NumberFormat.Int16BE</field>
<value name="address">
<shadow type="math_number" id="RjJ{^G_#*rwUqER:]i-L">
<field name="NUM">0</field>
</shadow>
<block type="device_get_digital_pin">
2020-08-19 22:03:58 +02:00
<field name="name">DigitalPin.C9</field>
</block>
</value>
<value name="value">
<shadow type="math_number" id="CCl{zdVU/!(bR}aUfG,G">
<field name="NUM">0</field>
</shadow>
<block type="device_get_analog_pin">
2020-08-19 22:03:58 +02:00
<field name="name">AnalogPin.C6</field>
</block>
</value>
<value name="repeat">
<shadow type="logic_boolean">
<field name="BOOL">FALSE</field>
</shadow>
</value>
<next>
<block type="spi_pins">
2020-08-19 22:03:58 +02:00
<field name="mosi">DigitalPin.C11</field>
<field name="miso">DigitalPin.C9</field>
<field name="sck">DigitalPin.C10</field>
<next>
<block type="device_set_pull">
2020-08-19 22:03:58 +02:00
<field name="pin">DigitalPin.C9</field>
<field name="pull">PinPullMode.PullDown</field>
<next>
<block type="device_analog_pitch">
<value name="frequency">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<value name="ms">
<shadow type="math_number">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="device_set_pin_events">
2020-08-19 22:03:58 +02:00
<field name="pin">DigitalPin.C8</field>
<field name="type">PinEventType.Touch</field>
<next>
<block type="device_analog_set_pitch_pin">
2020-08-19 22:03:58 +02:00
<field name="name">AnalogPin.C6</field>
<next>
<block type="spi_format">
<value name="bits">
<shadow type="math_number">
<field name="NUM">8</field>
</shadow>
</value>
<value name="mode">
<shadow type="math_number">
<field name="NUM">3</field>
</shadow>
</value>
<next>
<block type="spi_format">
<value name="bits">
<shadow type="math_number">
<field name="NUM">8</field>
</shadow>
</value>
<value name="mode">
<shadow type="math_number">
<field name="NUM">3</field>
</shadow>
</value>
<next>
<block type="spi_frequency">
<value name="frequency">
<shadow type="math_number">
<field name="NUM">1000000</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>