Difference between revisions of "Component: Input Digital Pin (DSP)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix Ltd
 
| Matrix Ltd
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.2 (Release)
+
| 1.2
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| DSP
 
| DSP
 
|}
 
|}
  
  
 +
==Input Digital Pin component==
 +
Allows the values from a buffer to be assigned from a digital input pin.  The input values for high and low state can be assigned using properties.
  
==[[File:Component Icon 8d6ffd33_4087_46b5_8dfd_f43513748755.png|Image]] Input Digital Pin component==
+
==Detailed description==
Allows the values from a buffer to be assigned from a digital input pin.
+
 
The input values for high and low state can be assigned using properties.
+
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
  
Line 25: Line 27:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>SamplePin</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Reads the value on the selected pin and based on the state outputs a value to the DSP buffer.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SamplePin'''
 +
|-
 +
| colspan="2" | Reads the value on the selected pin and based on the state outputs a value to the DSP buffer.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddLong'''
 +
|-
 +
| colspan="2" | Adds a single unsigned long value to the current location in the specified buffer and scales it appropriatley to suit the buffer.  Auto increments current location.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddInt'''
 +
|-
 +
| colspan="2" | Adds a single unsigned int value to the current location in the specified buffer and scales it appropriatley to suit the buffer.  Auto increments current location.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddLongArray'''
 +
|-
 +
| colspan="2" | Adds an array of long values to the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
==Simulation macro reference==
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddIntArray'''
 +
|-
 +
| colspan="2" | Adds an array of integer values to the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
  
''This component does not contain any simulation macros''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IsPlaying'''
 +
|-
 +
| colspan="2" | Checks to see if the last played track is still playing&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
==Property reference==
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
<span style="font-weight: normal;"><u>Buffer Size</u></span>
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetReplyByte'''
 +
|-
 +
| colspan="2" | Reads a single byte from the last reply. Each reply contains 4 bytes starting with the command code.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | Range: 0-3 / 0=Command, 1=Feedback, 2=Data MSB, 3=Data LSB&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SkipTrack'''
 +
|-
 +
| colspan="2" | Jump to the next or previous track&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Direction
 +
|-
 +
| colspan="2" | 0=Next, 1=Previous&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PlayTrack'''
 +
|-
 +
| colspan="2" | Plays track from the selected folder. MP3 & Advert folder track numbers should be 4 characters long e.g. 0001 any name.mp3, Other folder track numbers should be 3 characters long e.g. 001 Any name.mp3, Root the Track played in placement order.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Directory
 +
|-
 +
| colspan="2" | 0=Root, 1=Folder "01" - 99=Folder "99", 100=MP3, 101=Advert&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Track
 +
|-
 +
| colspan="2" | Track number 1="001*.MP3" / "0001*.MP3", 100="100*.MP3" / "0100*.MP3"&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''BuffSize''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Number of individual elements the buffer can store, default 1.
 
  
<span style="font-weight: normal;"><u>Buffer Type</u></span>
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAnalogAsInt'''
 +
|-
 +
| colspan="2" | Reads one of the analogue components as an Integer value&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | 0 = LDR, 1 = POT&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''BuffType''.
 
  
Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RemapCharacter'''
 +
|-
 +
| colspan="2" | Assigns a remap character allowing the PrintString function to automatically swap between pre-defined characters.  The characters can be custom (in the range 0-9) or can point to an existing character in the LCD character map.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | RemapIdx
 +
|-
 +
| colspan="2" | Remap Index, Range: 0 to (Remap Characters - 1)&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | SearchCharacter
 +
|-
 +
| colspan="2" | Character to look for a replace&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ReplacementCharacter
 +
|-
 +
| colspan="2" | New character value to use in place of the search character.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Start'''
 +
|-
 +
| colspan="2" | Startup routine required by the hardware device. Automatically clears the display after initialising.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
<span style="font-weight: normal;"><u>Pin Connection</u></span>
 
  
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Pin''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLEDState'''
 +
|-
 +
| colspan="2" | Sets the state of a single LED&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Port
 +
|-
 +
| colspan="2" | 0 = PortA, 1 = PortB&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | LED
 +
|-
 +
| colspan="2" | 0 = LED0, 7 = LED7&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | State
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Pin which is sampled to provide the DSP input to the buffer.
 
  
<span style="font-weight: normal;"><u>High Value</u></span>
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Must be called before any other CAN component macros to enable and initialise the CAN peripheral. &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''HighVal''.
 
  
Value to write to the buffer when the pin is in the high state.
 
  
<span style="font-weight: normal;"><u>Low Value</u></span>
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''LowVal''.
+
==Property reference==
  
Value to write to the buffer when the pin is in the low state.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Buffer Size
 +
|-
 +
| colspan="2" | Number of individual elements the buffer can store, default 1.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Buffer Type
 +
|-
 +
| colspan="2" | Sets the buffer data type, data is automatically scaled to fit and make full use of the data type.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | Pin Connection
 +
|-
 +
| colspan="2" | Pin which is sampled to provide the DSP input to the buffer.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | High Value
 +
|-
 +
| colspan="2" | Value to write to the buffer when the pin is in the high state.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | Low Value
 +
|-
 +
| colspan="2" | Value to write to the buffer when the pin is in the low state.&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 +
|-
 +
|}

Revision as of 16:53, 16 November 2021

Author Matrix Ltd
Version 1.2
Category DSP


Input Digital Pin component

Allows the values from a buffer to be assigned from a digital input pin. The input values for high and low state can be assigned using properties.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png SamplePin
Reads the value on the selected pin and based on the state outputs a value to the DSP buffer. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png AddLong
Adds a single unsigned long value to the current location in the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
Fc9-u32-icon.png - ULONG Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png AddInt
Adds a single unsigned int value to the current location in the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
Fc9-u16-icon.png - UINT Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png AddLongArray
Adds an array of long values to the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
Fc9-u32-icon.png - ULONG Data
 
Fc9-u16-icon.png - UINT Count
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png AddIntArray
Adds an array of integer values to the specified buffer and scales it appropriatley to suit the buffer. Auto increments current location. 
Fc9-u16-icon.png - UINT Data
 
Fc9-u16-icon.png - UINT Count
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png IsPlaying
Checks to see if the last played track is still playing 
[[File:]] - Return


Fc9-comp-macro.png GetReplyByte
Reads a single byte from the last reply. Each reply contains 4 bytes starting with the command code. 
Fc9-u8-icon.png - BYTE Index
Range: 0-3 / 0=Command, 1=Feedback, 2=Data MSB, 3=Data LSB 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SkipTrack
Jump to the next or previous track 
[[File:]] - Direction
0=Next, 1=Previous 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PlayTrack
Plays track from the selected folder. MP3 & Advert folder track numbers should be 4 characters long e.g. 0001 any name.mp3, Other folder track numbers should be 3 characters long e.g. 001 Any name.mp3, Root the Track played in placement order. 
Fc9-u8-icon.png - BYTE Directory
0=Root, 1=Folder "01" - 99=Folder "99", 100=MP3, 101=Advert 
Fc9-u16-icon.png - UINT Track
Track number 1="001*.MP3" / "0001*.MP3", 100="100*.MP3" / "0100*.MP3" 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Sets up the UART and does some housekeeping. Must be called before calling any of the other component macros. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadAnalogAsInt
Reads one of the analogue components as an Integer value 
Fc9-u8-icon.png - BYTE Channel
0 = LDR, 1 = POT 
[[File:]] - Return


Fc9-comp-macro.png RemapCharacter
Assigns a remap character allowing the PrintString function to automatically swap between pre-defined characters. The characters can be custom (in the range 0-9) or can point to an existing character in the LCD character map. 
Fc9-u8-icon.png - BYTE RemapIdx
Remap Index, Range: 0 to (Remap Characters - 1) 
Fc9-u8-icon.png - BYTE SearchCharacter
Character to look for a replace 
Fc9-u8-icon.png - BYTE ReplacementCharacter
New character value to use in place of the search character. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Start
Startup routine required by the hardware device. Automatically clears the display after initialising. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetLEDState
Sets the state of a single LED 
Fc9-u8-icon.png - BYTE Port
0 = PortA, 1 = PortB 
Fc9-u8-icon.png - BYTE LED
0 = LED0, 7 = LED7 
Fc9-u8-icon.png - BYTE State
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.  
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-21-icon.png Buffer Size
Number of individual elements the buffer can store, default 1. 
Fc9-type-16-icon.png Buffer Type
Sets the buffer data type, data is automatically scaled to fit and make full use of the data type. 
Fc9-type-5-icon.png Pin Connection
Pin which is sampled to provide the DSP input to the buffer. 
Fc9-type-21-icon.png High Value
Value to write to the buffer when the pin is in the high state. 
Fc9-type-21-icon.png Low Value
Value to write to the buffer when the pin is in the low state. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations