Component: Scale Linear Template (Advanced Shapes)

From Flowcode Help
Revision as of 10:38, 17 November 2021 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.2 |- | width="20%" style="color:gray...")
Jump to navigationJump to search
Author Matrix Ltd
Version 1.2
Category Advanced Shapes


Scale Linear Template component

A base component for drawing scales on horizontal or vertical strips. Can be used to simplify the building of rulers, meters and slider controls. Mouse handling is built in for easy construction of interactive controls.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Downloadable macro reference

Fc9-comp-macro.png GetValue
Get the current value from the scale. Will be either the most recent value set by "SetValue", or, if set to "Control" mode, the latest mouse clicked value. 
[[File:]] - Return


Fc9-comp-macro.png SetValue
Set the value for the scale. If a pointer object is defined, it will move to point at the new value. 
[[File:]] - Value
Value to set - will be constrained to the minumum-maximum range. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetLabel
Set the text of the component's label. 
Fc9-string-icon.png - STRING Text
New text to set. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRange
Set new maximum and minimum values for the scale. 
[[File:]] - Minimum
The minimum value of the scale (Bottom of the component) 
[[File:]] - Maximum
The maximum value of the scale (Top of the component) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRange
Set the minimum and maximum values of the scale 
[[File:]] - Minimum
Minimum value for the scale 
[[File:]] - Maximum
Maximum value for the scale 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png I2CTransInit
Initialises the I2C Transaction mode with the 7-bit device address 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DeviceAddress
7-bit Device Address 
Fc9-u8-icon.png - BYTE Baud
0=100KHz, 1=400KHz, 2=1MHz 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png IOSetOutputPin
Sets the selected digital pin to an output and assigns the output state. 
Fc9-u8-icon.png - BYTE Pin
Range: 0-29 
[[File:]] - State
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png UARTReceive
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SPIInitialise
Initialsie the SPI module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png I2CSend
Transmit a byte using the I2C bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
[[File:]] - Return


Fc9-comp-macro.png UARTSend
Send a byte via the UART module 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data Byte to send. Range: 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMSetPrescaler
Sets the prescaler for the PWM output 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Prescaler
 
Fc9-u8-icon.png - BYTE Period
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Enable a PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png IOSetOutputPin
Sets the selected digital pin to an output and assigns the output state. 
Fc9-u8-icon.png - BYTE Pin
Range: 0-29 
[[File:]] - State
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png UARTReceive
Receives a data byte from the UART. Recommend calling the UARTCheckRx function first to ensure data is available. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ADCSampleAverage10
Reads the voltage present on an Analog pin as an 10-bit value range 0-1023. Performs the selected number of samples with the selected time in microseconds in between samples 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 100 
Fc9-u8-icon.png - BYTE SampleDelay
Delay in us between each sample 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png OneWireScanBus
Scans the one wire bus to detect all connected devices. Returns the number of one wire devices found. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SPIInitialise
Initialsie the SPI module ready for communications 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - SPI Bus Count - 1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OneWireReceiveByte
Receives a byte from the one wire bus a bit at a time 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png I2CSend
Transmit a byte using the I2C bus 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE DataOut
 
[[File:]] - Return


Fc9-comp-macro.png UARTSend
Send a byte via the UART module 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - UART Bus Count - 1 
Fc9-u8-icon.png - BYTE Data
Data Byte to send. Range: 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png OneWireGetDeviceCount
Returns the number of devices found by the last ScanBus operation. 
Fc9-u8-icon.png - BYTE Channel
Channel Index: Range 0 - I2C Bus Count - 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png PWMSetPrescaler
Sets the prescaler for the PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0 - 11 
Fc9-u8-icon.png - BYTE Prescaler
 
Fc9-u8-icon.png - BYTE Period
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Enable a PWM output 
Fc9-u8-icon.png - BYTE Channel
Range: 0-11 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ADCSampleArray10
Reads the voltage present on an Analog pin as an 10-bit value range 0-1023 Performs the selected number of samples with the selected time in microseconds in between samples and returns each sample in a single packet 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 32 
Fc9-u16-icon.png - UINT SampleDelay
Delay in us between each sample 
Fc9-u16-icon.png - UINT Samples
10-bit samples returned from the function 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ADCSampleAverage8
Reads the voltage present on an Analog pin as an 8-bit value range 0-255 Performs the selected number of samples with the selected time in microseconds in between samples 
Fc9-u8-icon.png - BYTE ADCChannel
Range: 0, 3-7 
Fc9-u8-icon.png - BYTE SampleCount
Range: 1- 100 
Fc9-u8-icon.png - BYTE SampleDelay
Delay in us between each sample 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Initialise the comms to the Arduino board ready for commands to be sent. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
Fc9-u8-icon.png - BYTE EnableMask
Range 0-63 or 0b00000 to 0b111111 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-17-icon.png Pointer
Sets an object to act as the pointer for the scale. If in 'Display' mode, the pointer will move to show the incoming "SetValue" numbers. In "Control" mode, it will act as an object for setting the value using mouse clicks/drags. 
Fc9-type-17-icon.png Track
An object to represent a 'track' parallel to the scale upon which the moving part travels. If the scale is resized or moved, the 'track' object will also be scaled or moved. For example, the 'track' object could be a simple black rectangle to represent the 'slot' in which a slider control moves. 
Fc9-type-16-icon.png Orientation
Whether the scale and/or motion should be along the X-axis (horizontal) or Y-axis (vertical) 
Fc9-type-16-icon.png Function
Set the mode of the component... Display - the pointer object moves only when a value is set using the 'SetValue' macro. Control - the pointer can be moved using the mouse to set a new value, which can then be read using the 'GetValue' macro. 
Fc9-type-14-icon.png Resolution
Determines the amount of detail in the scale graphics - larger values will require more memory and/or loading time etc. 
Fc9-type-2-icon.png BG Color
Colour of the background object. 
Fc9-type-1-icon.png Positive Color
Markings colour for positive scale values. 
Fc9-type-1-icon.png Negative Color
Markings colour for negative values. 
Fc9-type-1-icon.png Label Color
Color for the text label. 
Fc9-type-14-icon.png Offset %
Distance of the main line from the left or bottom of the component. % of component size. 
Fc9-type-14-icon.png Start %
Start position of the scale from the left/bottom of the component. % of component size. 
Fc9-type-14-icon.png End %
End position of the scale from the left/bottom of the component. % of component size. 
Fc9-type-15-icon.png Thickness
Thickness of the main scale line. 
Fc9-type-7-icon.png Show
Whether to show or hide the main scale line. 
Fc9-type-14-icon.png Divisions
Number of major divisions of the scale - these can be numbered. 
Fc9-type-14-icon.png Offset %
Position of the division lines across the scale - % of component size,. 
Fc9-type-15-icon.png Thickness
Thickness of the division lines. 
Fc9-type-14-icon.png Subdivisions
Number of smaller divsions between the numbered ones. Set to zero if not required. 
Fc9-type-14-icon.png Subs Offset
Position of the sub-division line ends. % of width across the component. 
Fc9-type-15-icon.png Subs Thickness
Thickness of the sub-division lines.. 
Fc9-type-7-icon.png Show
Whether to show or hide the divisions and sub-divisions. 
Fc9-type-15-icon.png Maximum
Maximum number to show on the scale. 
Fc9-type-15-icon.png Minimum
Minimum number to show on the scale. 
Fc9-type-14-icon.png Decimals
Number of decimal places to show on the numbers. 
Fc9-type-14-icon.png Offset %
Distance acrross the scale width to show the numbers. % of component size. 
Fc9-type-14-icon.png Text Size %
Text height of the scale numbers. % of component size. 
Fc9-type-3-icon.png Font
Font for the scale numbers. 
Fc9-type-7-icon.png Show
Whether to show or hide the scale numbers. 
Fc9-type-10-icon.png Text
Text label for the component to aid identification. 
Fc9-type-14-icon.png Offset X %
X - position of the label. % of Width. 
Fc9-type-14-icon.png Offset Y %
Y position of label. % of height. 
Fc9-type-14-icon.png Text Size %
Text size of label. % of component size. 
Fc9-type-3-icon.png Font
Font for the component label. 
Fc9-type-7-icon.png Show
Whether to show or hide the text label. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations