Difference between revisions of "Component: Simulation Switch Template (Controls)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.3 |- | width="20%" style="color:gray...")
 
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
 
''No detailed description exists yet for this component''
 
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
 +
 +
  
  

Revision as of 21:08, 16 November 2021

Author Matrix Ltd
Version 1.3
Category Controls


Simulation Switch Template component

A base for building switches that do not download to chip. Mouse interaction can send 'System.User' events with the following data... ID = The handle of the switch component sending the message Message = 1 (on) or 0 (off) Current state can also be read via simulation macros.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png GetState
Read the current state of the switch. Returns BOOL true when the switch is on, or BOOL false when off. 
[[File:]] - Return


Fc9-comp-macro.png SetState
Sets the current state of the switch. BOOL true when the switch is on, or BOOL false when off. 
[[File:]] - SwitchState
Sets the state of the switch 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetDutyCycle
Sets the PWM duty cycle in terms of on/off based on the current period setting. E.g. if period = 255 then duty of 128 is equal to 50% on and 50% off. 16-bit PIC users should use the 10bit duty function to access the full range. 
Fc9-u8-icon.png - BYTE Duty
8-bit PWM duty 0-255 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Enable
Enables a PWM channel as an output overriding the default output pin state. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetFrequency
Sets a PWM of the specifed frequency at a duty of 50% Ideal use is a frequency generator 
Fc9-u32-icon.png - ULONG Frequency
Enter frequency in Hz 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetDutyCycle10Bit
PIC/AVR - Sets the full scale PWM duty cycle based on the current period setting. If period = 255 then Duty of 512 is equal to 50%. 16-bit PICs have a 16-bit period range available. If period = 65535 then Duty of 32768 is equal to 50%. 
Fc9-u16-icon.png - UINT Duty
PWM duty PIC/AVR: 0-1023 16-bit PIC: 0-65535 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Operation
Latching = Mouse click to turn on, click again to turn off. Momentary = Mouse click to turn on, release to turn off. 
Fc9-type-16-icon.png Send Event
Determine when the component will send a User event to its parent. On Change - Whenever the switch state changes. On Click - Only when the mouse clicks the object. On Release - Only when the mouse is released over the object. Never - No events.  
Fc9-type-17-icon.png Moving part
Handle of a panel object that will be the moving part of the switch. 
Fc9-type-17-icon.png Pivot object
Object around which the moving part will rotate when rotation is selected as the movement tyoe. 
Fc9-type-16-icon.png Type
Set whether the moving part will move linearly or by rotation. 
Fc9-type-16-icon.png Axis
Axis along which the moving part will move (for push/slide) or around which it will rotate (rotary). 
Fc9-type-15-icon.png Movement
Distance or angle by which the mioving part will move. 
Fc9-type-16-icon.png Show
Decide what label to show... None - no labels are displayed Name - shows the component's name Property - shows a property value of the component (a field for the property name will appear below) 
Fc9-type-16-icon.png Startup State
Default state of the indicator when loading the project or starting the simulation runtime. 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations