Difference between revisions of "Component: Switch (BL0145) (E-blocks 2)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| width="50%" |- | width="20%" style="color: gray;" | Author | Matrix TSL |- | width="20%" style="color: gray;" | Version | ...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| width="50%"
+
 
 +
{| width="50%"
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color: gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color: gray;" | Version
 
| 1.0 (Release)
 
| 1.0 (Release)
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color: gray;" | Category
 
| E-blocks 2
 
| E-blocks 2
 
|}
 
|}
Line 16: Line 17:
 
A set of 8 push switches that can be connected to an E-blocks 2 upstream board via a port connector.
 
A set of 8 push switches that can be connected to an E-blocks 2 upstream board via a port connector.
 
Switches are wired in an active high configuration.
 
Switches are wired in an active high configuration.
 +
 +
There are component macros to read the state of all switches at once or just one of the switches. You can also use macros to tell the program to wait until a certain switch is pressed. When reading the state of a certain switch you are asked to input the index value of that switch (0-7), the index values are displayed below the switches on the E-blocks 2 board.
 +
 +
Make sure the switch panel is connected to the correct port in flowcode corresponding to the port on your E-blocks 2 upstream board.
  
 
==Examples==
 
==Examples==
''<span style="color:red;">No additional examples</span>''
+
''<span style="color:red;">No additional examples</span>''
  
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;&lt;tt&gt;ReadState&lt;/tt&gt;&lt;/u&gt;&lt;/span&gt;===
+
===<span style="font-weight: normal;"><u><tt>ReadState</tt></u></span>===
 
Read the state of the switch at the given index.
 
Read the state of the switch at the given index.
  
&apos;&apos;&apos;Parameters&apos;&apos;&apos;
+
'''Parameters'''
  
:[[Variable Types|BYTE]] &apos;&apos;Index&apos;&apos;
+
:[[Variable Types|BYTE]] ''Index''
 
::The switch to read the status of.
 
::The switch to read the status of.
  
  
&apos;&apos;&apos;Return value&apos;&apos;&apos;
+
'''Return value'''
  
 
:[[Variable Types|BOOL]] : Key state - true = on, false = off
 
:[[Variable Types|BOOL]] : Key state - true = on, false = off
  
  
===&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;&lt;tt&gt;WaitUntilHigh&lt;/tt&gt;&lt;/u&gt;&lt;/span&gt;===
+
===<span style="font-weight: normal;"><u><tt>WaitUntilHigh</tt></u></span>===
 
Pause the program until the switch at the given index is turned on.
 
Pause the program until the switch at the given index is turned on.
  
&apos;&apos;&apos;Parameters&apos;&apos;&apos;
+
'''Parameters'''
  
:[[Variable Types|BYTE]] &apos;&apos;Index&apos;&apos;
+
:[[Variable Types|BYTE]] ''Index''
 
::Index of the switch to wait for.
 
::Index of the switch to wait for.
  
  
&apos;&apos;&apos;Return value&apos;&apos;&apos;
+
'''Return value'''
  
:&apos;&apos;This call does not return a value&apos;&apos;
+
:''This call does not return a value''
  
  
===&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;&lt;tt&gt;ReadAll&lt;/tt&gt;&lt;/u&gt;&lt;/span&gt;===
+
===<span style="font-weight: normal;"><u><tt>ReadAll</tt></u></span>===
 
Reads all of the switches at once, returning a byte containing one bit per
 
Reads all of the switches at once, returning a byte containing one bit per
  
 
switch.
 
switch.
  
&apos;&apos;&apos;Parameters&apos;&apos;&apos;
+
'''Parameters'''
  
:&apos;&apos;This macro has no parameters&apos;&apos;
+
:''This macro has no parameters''
  
  
&apos;&apos;&apos;Return value&apos;&apos;&apos;
+
'''Return value'''
  
 
:[[Variable Types|BYTE]] : One bit per switch in the array.
 
:[[Variable Types|BYTE]] : One bit per switch in the array.
  
  
===&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;&lt;tt&gt;WaitUntilLow&lt;/tt&gt;&lt;/u&gt;&lt;/span&gt;===
+
===<span style="font-weight: normal;"><u><tt>WaitUntilLow</tt></u></span>===
 
Pause the program until the switch at the given index is turned on.
 
Pause the program until the switch at the given index is turned on.
  
&apos;&apos;&apos;Parameters&apos;&apos;&apos;
+
'''Parameters'''
  
:[[Variable Types|BYTE]] &apos;&apos;Index&apos;&apos;
+
:[[Variable Types|BYTE]] ''Index''
 
::Index of the switch  to wait for.
 
::Index of the switch  to wait for.
  
  
&apos;&apos;&apos;Return value&apos;&apos;&apos;
+
'''Return value'''
  
:&apos;&apos;This call does not return a value&apos;&apos;
+
:''This call does not return a value''
  
  
Line 83: Line 88:
 
==Simulation macro reference==
 
==Simulation macro reference==
  
&apos;&apos;This component does not contain any simulation macros&apos;&apos;
+
''This component does not contain any simulation macros''
  
  
 
==Property reference==
 
==Property reference==
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;Input Mode&lt;/u&gt;&lt;/span&gt;
+
<span style="font-weight: normal;"><u>Input Mode</u></span>
  
This property is of type &apos;&apos;Fixed list of ints&apos;&apos; and can be referenced with the variable name &apos;&apos;port&apos;&apos;.
+
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''port''.
  
 
Choose how your switches are connected.
 
Choose how your switches are connected.
Line 97: Line 102:
 
Custom = Individual pin by pin connections
 
Custom = Individual pin by pin connections
  
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;u&gt;Port&lt;/u&gt;&lt;/span&gt;
+
<span style="font-weight: normal;"><u>Port</u></span>
  
This property is of type &apos;&apos;Digital port byte&apos;&apos; and can be referenced with the variable name &apos;&apos;PortByte&apos;&apos;.
+
This property is of type ''Digital port byte'' and can be referenced with the variable name ''PortByte''.
  
&apos;&apos;&lt;span style=&quot;color:red;&quot;&gt;No additional information&lt;/span&gt;&apos;&apos;
+
''<span style="color:red;">No additional information</span>''

Latest revision as of 14:40, 7 September 2018

Author Matrix TSL
Version 1.0 (Release)
Category E-blocks 2


Image Switch (BL0145) component

A set of 8 push switches that can be connected to an E-blocks 2 upstream board via a port connector. Switches are wired in an active high configuration.

There are component macros to read the state of all switches at once or just one of the switches. You can also use macros to tell the program to wait until a certain switch is pressed. When reading the state of a certain switch you are asked to input the index value of that switch (0-7), the index values are displayed below the switches on the E-blocks 2 board.

Make sure the switch panel is connected to the correct port in flowcode corresponding to the port on your E-blocks 2 upstream board.

Examples

No additional examples


Downloadable macro reference

ReadState

Read the state of the switch at the given index.

Parameters

BYTE Index
The switch to read the status of.


Return value

BOOL : Key state - true = on, false = off


WaitUntilHigh

Pause the program until the switch at the given index is turned on.

Parameters

BYTE Index
Index of the switch to wait for.


Return value

This call does not return a value


ReadAll

Reads all of the switches at once, returning a byte containing one bit per

switch.

Parameters

This macro has no parameters


Return value

BYTE : One bit per switch in the array.


WaitUntilLow

Pause the program until the switch at the given index is turned on.

Parameters

BYTE Index
Index of the switch to wait for.


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Input Mode

This property is of type Fixed list of ints and can be referenced with the variable name port.

Choose how your switches are connected.

PORT = Single port byte for all switches - pins are allocated in sequence from pin 0 - X

Custom = Individual pin by pin connections

Port

This property is of type Digital port byte and can be referenced with the variable name PortByte.

No additional information