Skip to content

Commit

Permalink
Add a limit switch example
Browse files Browse the repository at this point in the history
  • Loading branch information
TechplexEngineer committed Jun 24, 2014
1 parent d66c4d2 commit aa2f57e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/robotbuilder/modals/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h3>Using Joystick Button
</h3>
<div class="brief">How to use joystick buttons.</div>
</div>

<div class="example" data-file="doublesolenoud.xml">
<h3>Double Solenoid
<div class="pull-right inline-block">
Expand All @@ -33,6 +34,15 @@ <h3>Double Solenoid
<div class="brief">How to use a joystick button to control a double solenoid pneumatic valve.</div>
</div>

<div class="example" data-file="limitswitch.xml">
<h3>Limit Switch
<div class="pull-right inline-block">
<button type="button" class="btn btn-success load">Load</button>
</div>
</h3>
<div class="brief">How to use a limit switch to control a motor.</div>
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
Expand Down
47 changes: 47 additions & 0 deletions apps/robotbuilder/xml/examples/limitswitch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<xml>
<block type="init_declare" id="131" deletable="false" x="2" y="19">
<statement name="WHAT">
<block type="declare_motor_controller" id="146">
<field name="NAME">Roller1</field>
<field name="CONTROLLER_TYPE">Victor</field>
<field name="PORT">1</field>
<next>
<block type="declare_digital_input" id="152">
<field name="NAME">LimitSwitch1</field>
<field name="PORT">1</field>
</block>
</next>
</block>
</statement>
</block>
<block type="teleop_init" id="134" deletable="false" x="4" y="137"></block>
<block type="auto_init" id="132" deletable="false" x="466" y="122"></block>
<block type="auto_perodic" id="133" deletable="false" x="466" y="191"></block>
<block type="teleop_perodic" id="135" deletable="false" x="7" y="223">
<statement name="WHAT">
<block type="controls_if" id="159" inline="false">
<mutation else="1"></mutation>
<value name="IF0">
<block type="get_digital_input_value" id="162">
<field name="NAME">LimitSwitch1</field>
</block>
</value>
<statement name="DO0">
<block type="move_motor_controller" id="188" inline="true">
<field name="NAME">Roller1</field>
<value name="SPEED">
<block type="math_number" id="189">
<field name="NUM">1</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="stop_motor_controller" id="177">
<field name="NAME">Roller1</field>
</block>
</statement>
</block>
</statement>
</block>
</xml>

0 comments on commit aa2f57e

Please sign in to comment.