<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.flowcode.co.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JonnyW</id>
	<title>Flowcode Help - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.flowcode.co.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JonnyW"/>
	<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Special:Contributions/JonnyW"/>
	<updated>2026-05-13T02:26:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Components.Property&amp;diff=14483</id>
		<title>Event Components.Property</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Components.Property&amp;diff=14483"/>
		<updated>2014-01-31T08:35:17Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Sent when a property has been changed by the User&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Components|Components]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''This event has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
This event is called whenever a property owned by your component changes.&lt;br /&gt;
&lt;br /&gt;
This event simply notifies ''something'' has changed. This means changes will be accumulated, so changing three properties in quick succession will only result in a single event being sent. Because of this, it is the components responsibility to remember previous property states to establish what has changed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=API_Component.Property.SetListItem&amp;diff=14430</id>
		<title>API Component.Property.SetListItem</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=API_Component.Property.SetListItem&amp;diff=14430"/>
		<updated>2014-01-28T23:43:31Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: /* Detailed description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;API Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Sets an existing list entries text for the property by named index&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:25%; float:right&amp;quot; class=&amp;quot;toc&amp;quot;&amp;gt;&lt;br /&gt;
====Class hierarchy====&lt;br /&gt;
[[API Component|Component]]&lt;br /&gt;
:[[API Component.Property|Property]]&lt;br /&gt;
::[[API Component.Property|SetListItem]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Handle''&lt;br /&gt;
:The component handle to alter the property of&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|STRING]] ''Property''&lt;br /&gt;
:The textual name of the property&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|STRING]] ''Index''&lt;br /&gt;
:The text or integer entry of the property&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|STRING]] ''Value''&lt;br /&gt;
:The value to update the entry with&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|BOOL]]&lt;br /&gt;
&lt;br /&gt;
Returns true if the operation is a success, else false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
Sets the text part of a list property identified by its 3-digit ''Index''. If the line does not exist this call fails.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note the ''Index'' is not the line of the list to extract, but the 3-digit identifier. If multiple lines have the same identifier this will extract the first found.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find the index from the line, use [[API Component.Property.GetListIndex|GetListIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To add the line to the list regardless of whether it exists, use [[API Component.Property.AddListItem|AddListItem]].&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Calling in a calculation===&lt;br /&gt;
* Declare a variable 'result' of type BOOL&lt;br /&gt;
* Add to a calculation icon: &amp;lt;pre class=&amp;quot;brush:[cpp]&amp;quot;&amp;gt;result = ::Component.Property.SetListItem(handle, &amp;quot;property&amp;quot;, &amp;quot;index&amp;quot;, &amp;quot;value&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Gen_Window_Layout_Manager.png&amp;diff=14409</id>
		<title>File:Gen Window Layout Manager.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Gen_Window_Layout_Manager.png&amp;diff=14409"/>
		<updated>2014-01-27T15:01:14Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: JonnyW uploaded a new version of &amp;amp;quot;File:Gen Window Layout Manager.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dialog of the Window Layout manager&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Window_Layouts&amp;diff=14408</id>
		<title>Window Layouts</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Window_Layouts&amp;diff=14408"/>
		<updated>2014-01-27T15:00:45Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Select the Manage window layouts... option from the Window menu to open the Window Layouts dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This dialog allows you to customise Flowcode panes for easy transitions between different views. Up to ten layouts can be stored, including the default layout. These are mapped to the keys Ctrl-0 to Ctrl-9 while editing in Flowcode, whenever it is beneficial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gen_Window_Layout_Manager.png|right]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
====Save current====&lt;br /&gt;
Select this option to store the window layout in the currently selected slot. Flowcode will ask you to confirm if this overwrites an existing layout. This operation can not be undone.&lt;br /&gt;
&lt;br /&gt;
====Load workspace====&lt;br /&gt;
You can select this to restore the current workspace.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can hold the 'Ctrl' key down and press the corresponding number of that layout in the list or select from the ''Restore window layout'' option in the Flowcode Window menu.&lt;br /&gt;
&lt;br /&gt;
Ctrl-0 is always the default layout.&lt;br /&gt;
&lt;br /&gt;
====Rename====&lt;br /&gt;
This will allow you to rename the current workspace if one is selected&lt;br /&gt;
&lt;br /&gt;
====Delete====&lt;br /&gt;
This will prompt you to confirm, then delete the currently selected workspace. This operation can not be undone.&lt;br /&gt;
&lt;br /&gt;
====Move up and Move down====&lt;br /&gt;
These options allow you to sort your window layouts into an order preferable to you.&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Window_Layouts&amp;diff=14407</id>
		<title>Window Layouts</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Window_Layouts&amp;diff=14407"/>
		<updated>2014-01-27T14:59:30Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Select the Manage window layouts... option from the Window menu to open the Window Layouts dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This dialog allows you to customise Flowcode panes for easy transitions between different views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The current window layout can be stored here and recalled whenever it is beneficial.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen_Window_Layout_Manager.png|right]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
====Save current====&lt;br /&gt;
Select this option to store the window layout in the currently selected slot. Flowcode will ask you to confirm if this overwrites an existing layout. This operation can not be undone.&lt;br /&gt;
&lt;br /&gt;
====Load workspace====&lt;br /&gt;
You can select this to restore the current workspace.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can hold the 'Ctrl' key down and press the corresponding number of that layout in the list or select from the ''Restore window layout'' option in the Flowcode Window menu.&lt;br /&gt;
&lt;br /&gt;
Ctrl-0 is always the default layout.&lt;br /&gt;
&lt;br /&gt;
====Rename====&lt;br /&gt;
This will allow you to rename the current workspace if one is selected&lt;br /&gt;
&lt;br /&gt;
====Delete====&lt;br /&gt;
This will prompt you to confirm, then delete the currently selected workspace. This operation can not be undone.&lt;br /&gt;
&lt;br /&gt;
====Move up and Move down====&lt;br /&gt;
These options allow you to sort your window layouts into an order preferable to you.&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Window_Layouts&amp;diff=14406</id>
		<title>Window Layouts</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Window_Layouts&amp;diff=14406"/>
		<updated>2014-01-27T14:59:01Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: Created page with &amp;quot;Select the Manage window layouts... option from the Window menu to open the Window Layouts dialog.  This dialog allows you to customise Flowcode panes for easy transitions bet...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Select the Manage window layouts... option from the Window menu to open the Window Layouts dialog.&lt;br /&gt;
&lt;br /&gt;
This dialog allows you to customise Flowcode panes for easy transitions between different views.&lt;br /&gt;
&lt;br /&gt;
The current window layout can be stored here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gen_Window_Layout_Manager.png|right]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
====Save current====&lt;br /&gt;
Select this option to store the window layout in the currently selected slot. Flowcode will ask you to confirm if this overwrites an existing layout. This operation can not be undone.&lt;br /&gt;
&lt;br /&gt;
====Load workspace====&lt;br /&gt;
You can select this to restore the current workspace.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can hold the 'Ctrl' key down and press the corresponding number of that layout in the list or select from the ''Restore window layout'' option in the Flowcode Window menu.&lt;br /&gt;
&lt;br /&gt;
Ctrl-0 is always the default layout.&lt;br /&gt;
&lt;br /&gt;
====Rename====&lt;br /&gt;
This will allow you to rename the current workspace if one is selected&lt;br /&gt;
&lt;br /&gt;
====Delete====&lt;br /&gt;
This will prompt you to confirm, then delete the currently selected workspace. This operation can not be undone.&lt;br /&gt;
&lt;br /&gt;
====Move up and Move down====&lt;br /&gt;
These options allow you to sort your window layouts into an order preferable to you.&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=File:Gen_Window_Layout_Manager.png&amp;diff=14405</id>
		<title>File:Gen Window Layout Manager.png</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=File:Gen_Window_Layout_Manager.png&amp;diff=14405"/>
		<updated>2014-01-27T14:58:42Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: Dialog of the Window Layout manager&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dialog of the Window Layout manager&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Compile.AddVar&amp;diff=14382</id>
		<title>Event Compile.AddVar</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Compile.AddVar&amp;diff=14382"/>
		<updated>2014-01-23T11:24:40Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Sent to a component to allow dynamic amendment of global constant declarations&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Compile|Compile]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|STRING]] ''VarName''&lt;br /&gt;
:The original Flowcode variable&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|STRING]] ''ExpandName''&lt;br /&gt;
:The expanded variable name&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|STRING]] ''Expansion''&lt;br /&gt;
:The expanded string to inline to the code&lt;br /&gt;
:''This parameter is returned back to Flowcode''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
Non-zero to include definition - initialised on call&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On some PIC devices there are sometimes two types of RAM memory due to bus limitations, near and far. Near memory is fast to access but is limited by the size of the internal bus. Far memory is much less limited but means additional overhead when fetching or storing values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:FarMem.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When creating Flowcode variables these will default to being stored in near memory to optimise the time to fetch and store values. If you run out of room in near memory then you may get a message like this during compilation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''C:\Users\BenR\Desktop\FarMem.o: Link Error: Could not allocate section .nbss, size = 4118 bytes, attributes = bss near''' &lt;br /&gt;
&lt;br /&gt;
'''Link Error: Could not allocate data memory'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To tell the compiler to move the variable into FAR memory in C you would do something like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''__attribute__((far)) unsigned char data[4096];'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Flowcode variable defaults to something like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''MX_GLOBAL MX_UINT8 FCV_DATA[FCVsz_DATA]; // Large Data Array'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The AddVar event is used during the compile to C process to take the variables from the variable manager and generate the necessary C code. By calling a macro to run on this event we can tailor the way the variables are added to the C and add in the cast to FAR memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:AdVar.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first thing we need to do in the macro is compare the name of the variable that is currently being processed with the name of the variable we want to store into FAR memory. The string compare function returns 0 if the two strings match up so in the No branch of the decision we then add the &amp;quot;__attribute__((far)) &amp;quot; string to the expansion string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EvAddVar.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After saving the project and refreshing the C code window the variable now looks like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''__attribute__((far)) MX_GLOBAL MX_UINT8 FCV_DATA[FCVsz_DATA]; // Large Data Array'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And during compilation we now get this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Total data memory used (bytes):         0x1116  (4374) 15%'''&lt;br /&gt;
&lt;br /&gt;
'''...'''&lt;br /&gt;
&lt;br /&gt;
'''HEX file creation successful!'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the file as a demonstration.&lt;br /&gt;
&lt;br /&gt;
{{fcfile|FarMem.fcfx|Far Mem demo}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Dashboard_Panel&amp;diff=14352</id>
		<title>Dashboard Panel</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Dashboard_Panel&amp;diff=14352"/>
		<updated>2014-01-21T12:57:10Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Dashboard Panel provides a framework on which to load Flowcode components that compliments the [[System Panel]]. It is designed to show the representation of abstract components such as dials and meters during simulation.&lt;br /&gt;
&lt;br /&gt;
[[File:Dashboard Example 01.jpg|thumb|right|The Dashboard Panel]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Dashboard Panel is opened by selecting it in the View menu. Unlike the [[System Panel]], the Dashboard panel gives only a top-down view of the components, though they can be made more lifelike by clicking on the ‘3D view’ icon. [[File:Gen Panel Perspective 01.png|border]]. Components are typically designed in the [[System Panel]] and then used during programming in the dashboard.&lt;br /&gt;
&lt;br /&gt;
When the dashboard opens, you see a colored workspace. The color is set in the 'General Options'. [[File:Gen_Panel_General_Options_01.png|border]]&lt;br /&gt;
&lt;br /&gt;
===Differences to the System panel===&lt;br /&gt;
The Dashboard panel has a '''Shapes''' toolbar running vertically down the left-hand side, and a '''Controls''' toolbar running horizontally across the top. However these have more limited functionality on the [[System Panel]] as the Dashboard is not designed for modelling objects or creating components.&lt;br /&gt;
&lt;br /&gt;
[[Component|Components]] can be added to the Dashboard panel from the [[Tools and Views#3) Components Toolbar|Components Toolbar]] as they can to the System Panel. The intent is that this is used for more abstract and ''non-physical'' components such as dials and meters, though there is no restriction on what you can add.&lt;br /&gt;
&lt;br /&gt;
These components can then easily remain visible while the [[Camera Control|camera]] and any moving objects simulate on the System panel.&lt;br /&gt;
&lt;br /&gt;
The camera on the Dashboard is fixed, unlike the System panel which has full 3D movement.&lt;br /&gt;
&lt;br /&gt;
== Camera control ==&lt;br /&gt;
The Dashboard camera can only '''pan''', it will not '''rotate'''. This means the Dashboard always displays a top-down 2D appearance, though in reality it is capable of displaying any 3D object.&lt;br /&gt;
&lt;br /&gt;
To move and control the camera:&lt;br /&gt;
* Hold down the '''Ctrl''' key and click-drag the mouse to ''pan'' the camera (move the position of the camera).&lt;br /&gt;
* Hold down '''Alt''' and click anywhere on the panel to move the camera over that point or object (move the position of the camera to the object).&lt;br /&gt;
&lt;br /&gt;
===Zoom===&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Camera Zoom 01.png|border]] There is also a zoom facility, operated by pressing the '''Ctrl''' key and moving the cursor over the viewpoint icon. Clicking the mouse button in this and dragging downwards causes the view to zoom out. Dragging upwards causes the view to zoom in. The same functionality can be achieved by holding '''Ctrl''' and using the mouse wheel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Hint:''&lt;br /&gt;
:The coordinates of the cursor are shown in the status bar at the bottom of the screen. Using this information can help you to position objects.&lt;br /&gt;
&lt;br /&gt;
:First of all, move the cursor to the desired position, to find its coordinates. Then enter these into the 'Position' [[Component Properties|properties]] of the object in the [[Properties Panel]].&lt;br /&gt;
&lt;br /&gt;
==Selecting items==&lt;br /&gt;
Multiple items can be selected:&lt;br /&gt;
* By holding down the '''Shift''' key and then clicking on a number of items, one after the other;&lt;br /&gt;
* By left-clicking the mouse button and dragging over the items. &lt;br /&gt;
&lt;br /&gt;
They can then be grouped:&lt;br /&gt;
* By clicking on the 'Group' icon. [[File:Gen Panel Object Group 01.png|border]]&lt;br /&gt;
* By selecting the 'Group' option from the ‘Selection’ menu which appears when you click the right-hand mouse button. &lt;br /&gt;
&lt;br /&gt;
In this way, complex [[Component Tree|nested structures]] can be assembled from a number of parts.&lt;br /&gt;
To ungroup, select the object and then click on the same icon.&lt;br /&gt;
&lt;br /&gt;
== Shapes toolbar ==&lt;br /&gt;
[[File:Gen_Panel_Shapes_Toolbar_01.png|center|border]]&lt;br /&gt;
&lt;br /&gt;
At the top is a colour selector, which sets the colour of any shape added to the work area. By clicking on the down-arrow, one of a wide range of colours can be selected.&lt;br /&gt;
&lt;br /&gt;
Below it is the 'Text' icon, used to 'drag and drop' a single row of alphanumeric characters onto the work area. Afterwards, you can select it, by clicking on it, and configure it using the [[Properties Panel]]. In particular, when added, you can edit the default text displayed using the bottom ‘Text’ control on the Properties Panel.&lt;br /&gt;
&lt;br /&gt;
The next icon is a 'Textbox' icon. Unlike the text label this has multiple lines and the text does not stretch as its area is resized.&lt;br /&gt;
&lt;br /&gt;
The remaining icons allow you to add a variety of shapes, all two-dimensional, to the work area. Each takes the colour chosen in the colour selector at the top. Each one can be configured using the Properties Panel, to determine the position, size and rotation of the shape, for example.&lt;br /&gt;
&lt;br /&gt;
If 3D shapes are required any object can be dragged between the Dashboard and System panel and dropped in the required position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Controls toolbar ==&lt;br /&gt;
===Moving objects===&lt;br /&gt;
[[File:Gen Panel Object Controls 01.png|frame|center|Component controls]]&lt;br /&gt;
The first four controls operate on the size, position and rotation of the component. &lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Move 01.png|border]] '''Move''' allows you to move the selected object around the work area. &lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Stretch 01.png|border]] '''Stretch''' allows you to re-position a single point on an item. When you select an object and click on this control, pink anchors appear on the object. Selecting one of these allows it to be moved to a new position on the work area. The effect is to change the appearance, size or rotation of the object.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Scale 01.png|border]] '''Scale''' allows you to change the size of the object. After selecting an object and clicking on this control, a number of blue anchors appear on the object. Any of these can be dragged to re-size that particular dimension of the object. (Handles at the corners affect size in two dimensions.)&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Rotate 01.png|border]] '''Rotate''' allows you to rotate an object. After selecting it and clicking on this control, a number of yellow anchors appear on the object. These allow the object to be rotated around different axes. Corner anchors will spin the object.&lt;br /&gt;
&lt;br /&gt;
===General Options===&lt;br /&gt;
&lt;br /&gt;
The next control determines what happens when two objects ‘collide‘, with respect to the camera view. There are 3 options available:&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Collision Move Through.png|border]] '''Move Through''' ignores collision by moving through the colliding object and ignoring it completely.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Collision Move Around.png|border]] '''Move Around''' avoids collision by moving the object around the colliding object. '''''Note: this is the default option set by Flowcode.'''''&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Collision Move Over.png|border]] '''Move Over''' avoids collision by moving the object over the colliding object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next two controls are used to set properties for the whole panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Tools 01.png|border]] The first control, 'Tools' allows you to lock movement of objects:&lt;br /&gt;
* To the grid, &lt;br /&gt;
* To other objects,&lt;br /&gt;
* To the table-top&lt;br /&gt;
&lt;br /&gt;
The grid can be re-sized and made visible in a range of colors via this control. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel General Options 01.png|border]]&lt;br /&gt;
The second control, 'General Options' is used to:&lt;br /&gt;
* Set the colour or image of the display;&lt;br /&gt;
* Set the number of views, allowing, for example, plan and elevation views of a component;&lt;br /&gt;
* Set the ''level of detail'' of all the displays.&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=System_Panel&amp;diff=14351</id>
		<title>System Panel</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=System_Panel&amp;diff=14351"/>
		<updated>2014-01-21T12:54:44Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Gen System Panel Example 02.jpg|thumb||The System Panel]]&lt;br /&gt;
The System panel provides a real-world framework on which to load Flowcode components that compliments the [[Dashboard Panel]]. It is designed to show the physical representation of real world components during simulation.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The System Panel is opened by selecting it in the View menu. Unlike the [[Dashboard Panel]], the System Panel is designed to simulate a 3D environment. It is best suited to designing and positioning objects as all aspects of an object can be viewed. Once an object is designed, it is often used in projects via the [[Dashboard Panel]].&lt;br /&gt;
&lt;br /&gt;
When it opens, you see a central coloured square, called the ''Table top'', set against a coloured background. The colours or images of both are set in the 'General Options'. [[File:Gen_Panel_General_Options_01.png|border]]&lt;br /&gt;
&lt;br /&gt;
The System panel has a '''Shapes''' toolbar running vertically down the left-hand side, and a '''Controls''' toolbar running horizontally across the top.&lt;br /&gt;
&lt;br /&gt;
[[Component|Components]] can be added to the System panel from the [[Tools and Views#3)Components Toolbar|Components Toolbar]]. Then, input devices like [[Component: ID 953a042a b2aa 4f2e 94e2 ee2979cfc92e|switches]] can be operated to control the progress of the simulation, while output devices, like [[Component: ID a7b05886 784c 48c8 a6f6 cc371c7728e1|LEDs]] show the result.&lt;br /&gt;
&lt;br /&gt;
===Table top===&lt;br /&gt;
The Table top provides a 'surface' on which components are placed. It is a flat plane that objects can be placed on. When locked to the Table top, all objects sit on top of it and interact as solid objects.&lt;br /&gt;
&lt;br /&gt;
It is also useful as a surface for shadows, giving a sense of depth and orientation. The rotate mode of the camera treats the table top as the 'ground' and keeps the camera orientated with this in mind.&lt;br /&gt;
&lt;br /&gt;
===Video instructions===&lt;br /&gt;
&lt;br /&gt;
There are an array of videos at your disposal to educate you and improve your skills using Flowcode, to get started with the System Panel see the [http://www.youtube.com/watch?v=2VvUSCCc-sE&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ&amp;amp;index=8 Introduction to the System Panel] video for an overview of the fundamental functionality available using the System Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
{{#ev:youtube|2VvUSCCc-sE|640}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Camera control==&lt;br /&gt;
The [[Camera Control|camera]] (viewpoint) can be panned or rotated around different axes using the three icons shown.&lt;br /&gt;
&lt;br /&gt;
These work in conjunction with the Ctrl, Shift and Alt keys and with the three coloured arrow heads that show the camera orientation. &lt;br /&gt;
&amp;lt;gallery widths=64x52px perrow=3 caption=&amp;quot;Camera controls&amp;quot; style=&amp;quot;margin:auto; text-align:center;&amp;quot;&amp;gt;&lt;br /&gt;
File:Gen_Panel_Camera_Pan_01.png|'''Pan'''&lt;br /&gt;
File:Gen_Panel_Camera_Rotate_01.png|'''Rotate'''&lt;br /&gt;
File:Gen_Panel_Camera_Orbit_01.png|'''Orbit'''&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To move and control the camera:&lt;br /&gt;
* Hold down the '''Ctrl''' key and click-drag the mouse to move the camera eye (the position of the camera).&lt;br /&gt;
* Hold down both the '''Ctrl''' and '''Shift''' keys and click-drag the mouse to move the camera target (the view of the camera).&lt;br /&gt;
* Hold down '''Alt''' and click anywhere on the panel to move the camera over that point or object (move the camera to the object).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Zoom===&lt;br /&gt;
[[File:Gen_Panel_Camera_Zoom_01.png|border]] There is also a zoom facility, operated by pressing the '''Ctrl''' key and moving the cursor over the viewpoint icon. Clicking the mouse button in this and dragging downwards causes the view to zoom out. Dragging upwards causes the view to zoom in. The same functionality can be achieved by holding Ctrl and using the mouse wheel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Axis alignment===&lt;br /&gt;
The coloured arrows in the top left corner of the panel show the orientation of the camera. You can click any of these arrows to reset the view to look in that axis.&lt;br /&gt;
&lt;br /&gt;
For example, clicking on the blue arrow gives a top-down view – looking down the ‘Z’ axis. Clicking on one of the other coloured arrows rotates the object about that axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Hint:''&lt;br /&gt;
:The coordinates of the cursor are shown in the status bar at the bottom of the screen. Using this information can help you to position objects.&lt;br /&gt;
&lt;br /&gt;
:First of all, move the cursor to the desired position, to find its coordinates. Then enter these into the 'Position' [[Component Properties|properties]] of the object in the [[Properties Panel]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Video instructions===&lt;br /&gt;
See the following Youtube videos to learn how to effectively control the camera and navigate the panels:&lt;br /&gt;
&lt;br /&gt;
The [http://www.youtube.com/watch?v=CERJCvyInV8&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Camera Control 1] video covers the basic camera controls and camera rotation and general camera manipulation.&lt;br /&gt;
&lt;br /&gt;
The [http://www.youtube.com/watch?v=uG20xwQtcCM&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Camera Control 2] video covers slightly more advanced features such as using keyboard shortcuts as well as mouse movement to navigate the panel more effectively.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{{#ev:youtube|CERJCvyInV8}}&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; |&lt;br /&gt;
|{{#ev:youtube|uG20xwQtcCM}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Manipulating objects==&lt;br /&gt;
&lt;br /&gt;
===Selecting items===&lt;br /&gt;
Multiple items can be selected:&lt;br /&gt;
* By holding down the '''Shift''' key and then clicking on a number of items, one after the other;&lt;br /&gt;
* By left-clicking the mouse button and dragging over the items. &lt;br /&gt;
&lt;br /&gt;
They can then be grouped:&lt;br /&gt;
* By clicking on the 'Group' icon. [[File:Gen_Panel_Object_Group_01.png|border]]&lt;br /&gt;
* By selecting the 'Group' option from the ‘Selection’ menu which appears when you click the right-hand mouse button. &lt;br /&gt;
&lt;br /&gt;
In this way, complex [[Component Tree|nested structures]] can be assembled from a number of parts.&lt;br /&gt;
To ungroup, select the object and then click on the same icon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Shapes toolbar===&lt;br /&gt;
At the top is a colour selector, which sets the colour of any shape added to the work area. By clicking on the down-arrow, one of a wide range of colours can be selected.&lt;br /&gt;
&lt;br /&gt;
Below that there is a button to swap between 2D and 3D shapes on the toolbar, this allows you to quickly and easily access different shapes and differentiate the 2D and 3D shapes with ease as they are separated into different sections. All objects can be dragged between the Dashboard and System panel and dropped in the required position, although the 3D shapes cannot be found on the Dashboard Panel shapes toolbar.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen_Panel_Shapes_Toolbar_01.png|center|border]]&lt;br /&gt;
&lt;br /&gt;
Under the 2D section there is a 'Text' icon, used to 'drag and drop' a single row of alphanumeric characters onto the work area. Afterwards, you can select it, by clicking on it, and configure it using the [[Properties Panel]]. In particular, when added, you can edit the default text displayed using the bottom ‘Text’ control on the Properties panel. As well as text, there are also a few two-dimensional shapes available, including; '''Ellipse''' (circle), '''Rectangle''', '''Rounded Rectangle''' and '''Line'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The remaining icons under the 3D section allow you to add a variety of three-dimensional shapes to the work area. Each takes the colour chosen in the colour selector at the top. Each shape can be configured using the Properties Panel, to determine the position, scale, rotation and even the colour of the shape.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Video instructions===&lt;br /&gt;
Watch the [http://www.youtube.com/watch?v=2yT5XTLLX6o&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Adding Objects to the Panel] video for a demonstration and explanation about adding components and objects to the System Panel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See the [http://www.youtube.com/watch?v=5-IzDJ2NDcc&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Aligning Objects on the Panel 1] video to learn the basics of aligning objects on the panel, this video covers the all available options of the 'Snap to' function including Snap to '''''Grid''''', '''''Objects''''' and '''''Table top'''''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next video, [http://www.youtube.com/watch?v=okbJ9pJrEeA&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Aligning Objects on the Panel 2], expands onto manipulating objects by moving, rotating and scaling / re-sizing objects to align them on the panel, this video makes use of the [[Project Explorer]] in order to manipulate the objects precisely.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, the [http://www.youtube.com/watch?v=0b0jtQzBS9Q&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Alignig Objects on the Panel 3] video details additional options to effectively align objects on the panel, this includes various options from the context menu when you right-click a selected object.&lt;br /&gt;
{| style=&amp;quot;margin:auto; text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|{{#ev:youtube|2yT5XTLLX6o}}&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; |&lt;br /&gt;
|{{#ev:youtube|5-IzDJ2NDcc}}&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; | &amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|{{#ev:youtube|okbJ9pJrEeA}}&lt;br /&gt;
| width=&amp;quot;100px&amp;quot; |&lt;br /&gt;
|{{#ev:youtube|0b0jtQzBS9Q}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Controls toolbar==&lt;br /&gt;
===Moving objects===&lt;br /&gt;
The first four controls operate on the size, position and rotation of the component. &lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Controls 01.png|frame|center|Component controls]]&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Move 01.png|border]] '''Move''' allows you to move the selected object around the work area. &lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Stretch 01.png|border]] '''Stretch''' allows you to re-position a single point on an item. When you select an object and click on this control, pink anchors appear on the object. Selecting one of these allows it to be moved to a new position on the work area. The effect is to change the appearance, size or rotation of the object.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Scale 01.png|border]] '''Scale''' allows you to change the size of the object. After selecting an object and clicking on this control, a number of blue anchors appear on the object. Any of these can be dragged to re-size that particular dimension of the object. (Handles at the corners affect size in two dimensions.)&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Rotate 01.png|border]] '''Rotate''' allows you to rotate an object. After selecting it and clicking on this control, a number of yellow anchors appear on the object. These allow the object to be rotated around different axes. Corner anchors will spin the object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Controlling the camera===&lt;br /&gt;
The next three controls determine the camera (viewpoint) behavior.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Camera Controls 01.png|frame|center|Camera controls]]&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Camera Pan 01.png|border]] '''Pan''' allows the  camera to pan left / right / up / down.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Camera Rotate 01.png|border]] '''Rotate''' allows the camera to rotate assuming the table top is the ground.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Camera Orbit 01.png|border]] '''Orbit''' third allows the camera to rotate without considering the table top.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===General Options===&lt;br /&gt;
&lt;br /&gt;
The next control determines what happens when two objects ‘collide‘, with respect to the camera view. There are 3 options available:&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Collision Move Through.png|border]] '''Move Through''' ignores collision by moving through the object and ignoring collision completely.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Collision Move Around.png|border]] '''Move Around''' avoids collision by moving the object around the colliding object. '''''Note: this is the default option set by Flowcode.'''''&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Object Collision Move Over.png|border]] '''Move Over''' avoids collision by moving the object over the colliding object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gen_Panel Camera Align 01.png|border]] The '''Align Axis''' control is used to mirror the axis of the selected object, this follows the alignment of the component axis, even when being manipulated and rotated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next two controls are used to set properties for the whole panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel Tools 01.png|border]] The first control, 'Tools' allows you to lock movement of objects:&lt;br /&gt;
* To the grid, &lt;br /&gt;
* To other objects,&lt;br /&gt;
* To the table-top&lt;br /&gt;
&lt;br /&gt;
The grid can be re-sized and made visible in a range of colors via this control. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gen Panel General Options 01.png|border]]&lt;br /&gt;
The second control, 'General Options' is used to:&lt;br /&gt;
* Set the colour or image of the display;&lt;br /&gt;
* Set the number of views, allowing, for example, plan and elevation views of a component;&lt;br /&gt;
* Set the ''level of detail'' of all the displays.&lt;br /&gt;
&lt;br /&gt;
== Multiple views==&lt;br /&gt;
A powerful feature of Flowcode 6 is the ability to view the components from several camera angles simultaneously, enabling orthographic design of the system. Up to four views can be shown. &lt;br /&gt;
&lt;br /&gt;
The number of views can be changed by clicking the 'General Options' [[File:Gen Panel General Options 01.png|border]] icon and then clicking on the drop down menu [[File:Btn_Menu_Arrow.png]] next to the 'Number of views:' option and then selecting a value from 1-4 on the menu.&lt;br /&gt;
&lt;br /&gt;
By clicking on the appropriate arrowheads, you can set up each view as shown below.&lt;br /&gt;
&lt;br /&gt;
Depending on the size and shape of the Systems Panel, the three views may be arranged vertically, instead of horizontally. Drag one edge of the Systems Panel sideways to see this effect.&lt;br /&gt;
[[File:gen_exerciseSystemPanelshapecontrol_threeview1_01.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
You can adjust the viewpoint individually for each view, by operating the 'camera position' controls.&lt;br /&gt;
&lt;br /&gt;
An example of doing so is given below - notice the positions of the red, green and blue arrows in each:&lt;br /&gt;
[[File:gen_exerciseSystemPanelshapecontrol_threeview2_01.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can make changes to the objects themselves, in which case all three views are affected at once.&lt;br /&gt;
&lt;br /&gt;
In the next image, the instrument panel has been rotated:&lt;br /&gt;
[[File:gen_exerciseSystemPanelshapecontrol_threeview3_01.png|500px|center]]&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Interrupts&amp;diff=14339</id>
		<title>Exercise - Using Interrupts</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Interrupts&amp;diff=14339"/>
		<updated>2014-01-16T15:59:52Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: What Is an Interrupt?&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Interrupts are a way of grabbing the microcontroller's attention immediately.&lt;br /&gt;
&lt;br /&gt;
They are very widely used, both in microcontrollers and microprocessors. For example, the keyboard and mouse in your computer probably use interrupts to talk to the CPU.&lt;br /&gt;
&lt;br /&gt;
They can also be used to save energy. In many battery-powered applications, the microcontroller is 'put to sleep' when inactive, and so requires little energy. An interrupt is used to 'awaken' the controller, and bring it back into operation, when needed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise shows how to use an interrupt to sense when a switch is closed, (an external interrupt).&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Polling vs interrupt==&lt;br /&gt;
&lt;br /&gt;
The microcontroller is often connected to a large number of peripheral input devices - switches, sensors, memory, timers etc. &lt;br /&gt;
There are two broad ways in which one of these devices can be serviced by the microcontroller:&lt;br /&gt;
* polling - each device is 'asked' in turn if it has data to transfer to the controller;&lt;br /&gt;
* interrupts - allow the device to interrupt the task being carried out by the controller.&lt;br /&gt;
&lt;br /&gt;
The exercise aims to show the difference between polling and using interrupts. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The system==&lt;br /&gt;
&lt;br /&gt;
This exercise sets up a system with LEDs controlled by two switches:&lt;br /&gt;
::* Switch 1 is polled by the program, at regular intervals.&amp;lt;br /&amp;gt;&lt;br /&gt;
::* Switch 2 initiates an interrupt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The polled switch, switch 1, is checked at regular (and predictable) intervals - every six seconds in this example.&lt;br /&gt;
Switch 2 is connected so that as soon as it operates, the processor stops what it is doing and jumps to the Interrupt Service Routine (ISR). In the process, the return address is stored, so that at the end of the ISR, the processor can return to where it left the main program. In Flowcode, the ISR takes the form of a macro, configured like any other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The flowchart==&lt;br /&gt;
&lt;br /&gt;
The flowchart sequence:&lt;br /&gt;
:* Check if switch 1 is pressed.&lt;br /&gt;
:: If it isn't, make the red LED flash slowly.&lt;br /&gt;
:: If it is, make the yellow LED flash slowly.&lt;br /&gt;
:* Go back to the beginning and repeat the process.&lt;br /&gt;
:* Whenever switch 2 is pressed, immediately make both LEDs flash quickly ten times and then go back to the main program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The main program==&lt;br /&gt;
&lt;br /&gt;
* [[Creating Flowcharts|Start a new Flowcode flowchart]], using the default microcontroller.&lt;br /&gt;
&lt;br /&gt;
* Make sure that the [[System Panel]] is visible. If necessary, click on [[View]] and then select 'System Panel' a check-box will appear next to the option when enabled.&lt;br /&gt;
&lt;br /&gt;
* Drag and drop a 'Loop' icon between the BEGIN and END icons.&lt;br /&gt;
&lt;br /&gt;
* Inside the loop, drag and drop an 'Input' icon from the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
&lt;br /&gt;
* Drag and drop a 'Decision' icon after the 'Input' icon.&lt;br /&gt;
&lt;br /&gt;
Next, add icons to control what happens when switch is not pressed, (and so the program follows the 'No' branch):&lt;br /&gt;
&lt;br /&gt;
* Drag and drop an 'Output' icon in the 'No' branch.&lt;br /&gt;
: This icon is going to turn the red LED on.&lt;br /&gt;
&lt;br /&gt;
* Drag and drop a 'Delay' icon after the 'Output' icon.&lt;br /&gt;
: This will keep the LED on for three seconds.&lt;br /&gt;
&lt;br /&gt;
* Follow it with another 'Output' icon.&lt;br /&gt;
: This icon is going to turn the LED off.&lt;br /&gt;
&lt;br /&gt;
* Add a second 'Delay' icon next.&lt;br /&gt;
: This will keep the LED off for three seconds.&lt;br /&gt;
&lt;br /&gt;
The program then loops back and checks the state of the switch again.&lt;br /&gt;
&lt;br /&gt;
Next, add icons to control what happens when switch is pressed, and so the program follows the 'Yes' branch:&lt;br /&gt;
&lt;br /&gt;
* Drag and drop an 'Output' icon in the 'Yes' branch.&lt;br /&gt;
&lt;br /&gt;
* Drag and drop a 'Delay' icon after the 'Output' icon.&lt;br /&gt;
&lt;br /&gt;
* Follow it with another 'Output' icon.&lt;br /&gt;
&lt;br /&gt;
* Add a second 'Delay' icon next.&lt;br /&gt;
&lt;br /&gt;
The program then loops back, as before, and checks the state of the switch again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add switch 1 and the LEDs ==&lt;br /&gt;
&lt;br /&gt;
* Locate the 'Inputs' toolbox, and click on the down arrow next to the switch labelled 'Toggle Metal PCB'. [[File:Component Icon c6c91999 1fe0 414e b6aa 0a7ddc9a6417.png]]&lt;br /&gt;
: Click on the 'Add to system panel' option.&lt;br /&gt;
: Configure its properties so that it is connected to Port B, bit 1.&lt;br /&gt;
&lt;br /&gt;
* Locate the 'Outputs' toolbox, and click on the down arrow next to the 'LED Array' label. [[File:Component Icon c8da67a7 fc7b 48c0 8c3f 3264c74f4024.png]]&lt;br /&gt;
: Click on the 'Add to system panel' option.&lt;br /&gt;
* Click on one, and configure its properties as follows&lt;br /&gt;
:: set the 'Count' property to &amp;quot;2&amp;quot;, to give two LEDs in the array;&lt;br /&gt;
:: set the colour of LED0 to red, and that of LED1 to yellow.&lt;br /&gt;
:: LED0 will light when Port A is sent value '1', and LED1 will light when Port A is sent value '3';&lt;br /&gt;
:: check that the 'Connections' property shows that it is connected to Port A.&lt;br /&gt;
&lt;br /&gt;
Double click on each icon in the flowchart and configure it as shown in the following images:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Configuring the icons&amp;quot; perrow=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
File:Exercise_UsingInt_redLEDon.jpg|Turn the red LED on&lt;br /&gt;
File:Exercise_UsingInt_3sdelay.jpg|Three seconds delay&lt;br /&gt;
File:Exercise_UsingInt_LEDoff.jpg|Turn the LEDs off&lt;br /&gt;
File:Exercise_UsingInt_yellLEDon.jpg|Turn on the yellow LED&lt;br /&gt;
File:Exercise_UsingInt_sw1_prop.jpg|Configure switch 1&lt;br /&gt;
File:Exercise_UsingInt_decision.jpg|Configure the decision icon&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see a larger version, double click on the image.&lt;br /&gt;
&lt;br /&gt;
Simulate the flowchart to make sure that the LEDs behave as expected.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add switch 2==&lt;br /&gt;
[[File:Exercise_UsingInt_int_prop.jpg|200px|right]]&lt;br /&gt;
&lt;br /&gt;
* Add a second 'Toggle Metal PCB' switch to the system panel.&lt;br /&gt;
: Configure its properties so that it is connected to Port B, bit 0 - the hardware interrupt bit.&lt;br /&gt;
* Drag and drop an interrupt icon [[File:Btn_Interrupt.gif|border]] between 'BEGIN'and the upper loop icon, (although it will work anywhere in the flowchart.)&lt;br /&gt;
: Double click on the icon, and configure it as shown opposite.&lt;br /&gt;
* The next task is to create the ISR. Click on the 'Create New Macro...' button.&lt;br /&gt;
[[File:Exercise UsingInt Int flashfastmacro.jpg|200px|right]]&lt;br /&gt;
&lt;br /&gt;
* The 'Create a New Macro' dialogue box opens. &lt;br /&gt;
: Give the macro the name &amp;quot;flash_fast&amp;quot;.&lt;br /&gt;
: Click on OK.&lt;br /&gt;
&lt;br /&gt;
* In the 'Properties:Interrupt' dialogue box, click on the 'OK &amp;amp; Edit Macro' button.&lt;br /&gt;
: Create the flowchart shown opposite for the macro.&lt;br /&gt;
: Sending value '3' (=00011 in binary,) to Port A switches on both LEDs.&lt;br /&gt;
&lt;br /&gt;
==The main flowchart==&lt;br /&gt;
&lt;br /&gt;
Your flowchart should now be set up to resemble the image below: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_UsingInt_main.jpg|350px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test the system==&lt;br /&gt;
&lt;br /&gt;
Earlier, you tested the effect of switch 1 on the LEDs. Now you can test the effect of switch 2 as well.&lt;br /&gt;
* Run the simulation, and confirm the action of switch 1 on the LEDs.&lt;br /&gt;
* While Flowcode is simulating a three second delay, toggle switch 2 on and off.&lt;br /&gt;
: The  three second simulationshould stop, mid-delay, and both LEDs should flash quickly, ten times, as specified in the ISR.&lt;br /&gt;
: After this, the microcontroller resumes the main program from where it left off, the three second delay.&lt;br /&gt;
* Repeat the tests until you are happy with the way the system operates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Using Interrupts.fcfx|Exercise - Using Interrupts}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Simulation_Macros&amp;diff=14340</id>
		<title>Exercise - Using Simulation Macros</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Simulation_Macros&amp;diff=14340"/>
		<updated>2014-01-16T15:59:52Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: What Is a Macro?&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Simulation macros are a form of Component macros. Their purpose is to make simulation more realistic by adding physical components to the electronic devices.&lt;br /&gt;
&lt;br /&gt;
When the Flowcode program is compiled and downloaded to a microcontroller, they are ignored - hence the name Simulation macros. &lt;br /&gt;
&lt;br /&gt;
Even a cursory glance at the dialogue box used to configure them shows that they are very powerful devices, with a huge range of possible effects.&lt;br /&gt;
&lt;br /&gt;
This exercise uses three of them to illustrate the use of a PIR (Passive Infra-Red sensor) to operate an intruder sensor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The scenario==&lt;br /&gt;
&lt;br /&gt;
The scene depicts the front of a house. &lt;br /&gt;
[[File:Exercise SimIcon pan.png|center|350px]]&lt;br /&gt;
&lt;br /&gt;
A PIR sensor is mounted on the wall of the house, above the path leading across the garden.&lt;br /&gt;
&lt;br /&gt;
The data sheet for the PIR shows that it is sensitive to a range of 10 metres, within a cone of angle 100 degrees.&lt;br /&gt;
&lt;br /&gt;
Its detection area is represented in the image by the pale blue cone.&lt;br /&gt;
&lt;br /&gt;
When an intruder enters the detection cone, a warning lamp lights up in the house.&lt;br /&gt;
&lt;br /&gt;
This exercise allows us to investigate factors such as the height of the sensor on the brick wall and the angle of the detection zone, so that these can be optimised for a typical intruder height.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The System Panel==&lt;br /&gt;
&lt;br /&gt;
On the System Panel, viewed from above (the default position,)create:&lt;br /&gt;
* '''a brick wall''', represented by adding a red cuboid and changing it to a rectangle, 15mm wide, 120mm high and 120mm deep, &lt;br /&gt;
:: located at coordinates x = 0, y = 0, z = 60, &lt;br /&gt;
:: with rotation settings X = 0, Y = 0, Z = 0;&lt;br /&gt;
&lt;br /&gt;
* '''a path''', represented by a grey rectangle, 240mm wide, 100mm high and 0mm deep, &lt;br /&gt;
:: located at coordinatesx = 125mm, y = 0mm, z = 0mm, &lt;br /&gt;
:: with rotation settings of X = 0, Y = 0, Z = 0;&lt;br /&gt;
&lt;br /&gt;
* '''a cone''', couloured light blue, representing the sensing region of the PIR, with width = 70mm, height = 250mm, depth 95mm, &lt;br /&gt;
:: located at coordinates x = 45mm, y = 0mm, z = 80mm, &lt;br /&gt;
:: with rotation settings of X = 0, Y = -55, Z = 0.&lt;br /&gt;
&lt;br /&gt;
* Drag the mouse cursor over these three elements and group them together. &lt;br /&gt;
&lt;br /&gt;
This produces 'group 1'. &lt;br /&gt;
:: Give this group:&lt;br /&gt;
::: dimensions - width = 265mm, height = 250mm, depth = 135mm;&lt;br /&gt;
::: coordinates - x = 128, y = 0, z = 68;&lt;br /&gt;
::: rotation - X = 0, Y = 0, Z = 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also on the System Panel, create an intruder, by:&lt;br /&gt;
* adding four spheres, and configuring the properties as follows:&lt;br /&gt;
:: sphere 1 ('''the head'''):&lt;br /&gt;
::: colour pink;&lt;br /&gt;
::: dimensions - width = 12mm, height = 13mm, depth = 15mm;&lt;br /&gt;
::: coordinates - x = -2.2, y = 0.7, z = 22;&lt;br /&gt;
::: rotation - X = 90, Y = 0, Z = 0.&lt;br /&gt;
&lt;br /&gt;
:: sphere 2 ('''the body'''):&lt;br /&gt;
::: colour blue;&lt;br /&gt;
::: dimensions - width = 14mm, height = 26mm, depth = 24mm;&lt;br /&gt;
::: coordinates - x = -2.2, y = 0.5, z = 4;&lt;br /&gt;
::: rotation - X = 90, Y = 0, Z = -180.&lt;br /&gt;
&lt;br /&gt;
:: sphere 3 ('''the legs'''):&lt;br /&gt;
::: colour dark green;&lt;br /&gt;
::: dimensions - width = 9mm, height = 23mm, depth = 15mm;&lt;br /&gt;
::: coordinates - x = -2.2, y = 1, z = -16;&lt;br /&gt;
::: rotation - X = 90, Y = 0, Z = -180.&lt;br /&gt;
&lt;br /&gt;
:: sphere 4 ('''the feet'''):&lt;br /&gt;
::: colour black;&lt;br /&gt;
::: dimensions - width = 6mm, height = 15mm, depth = 25mm;&lt;br /&gt;
::: coordinates - x = -6, y = 0, z = -25;&lt;br /&gt;
::: rotation - X = 90, Y = 90, Z = 0.&lt;br /&gt;
&lt;br /&gt;
* Drag the mouse cursor over the four spheres and group them together.&lt;br /&gt;
&lt;br /&gt;
This produces 'group 2'. &lt;br /&gt;
:: Give it:&lt;br /&gt;
::: dimensions - width = 18mm, height = 32mm, depth = 60mm;&lt;br /&gt;
::: coordinates - x = 165, y = 0, z = 28;&lt;br /&gt;
::: rotation - X = 0, Y = 0, Z = 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The System Panel should resemble the image shown above. (The image has been rotated to show all components. The table-top is coloured green.)&lt;br /&gt;
&lt;br /&gt;
Click on the 'Collisions' icon, [[File:Gen Panel Object Collision Move Around.png|35px]]    and select the 'Move through' option, which allows the intruder to enter the detection cone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Dashboard Panel==&lt;br /&gt;
[[File:Exercise SimIcon dash.png|right|200px]]&lt;br /&gt;
* Open the 'Outputs' toolbox, and locate the 'LED 5mm Panel' device.&lt;br /&gt;
* Click on the down arrow next to it and choose the 'Add to dashboard panel' option.&lt;br /&gt;
* Zoom in to the Dashboard Panel to make the LED large enough to see.&lt;br /&gt;
* Click on the LED and configure its properties as follows:&lt;br /&gt;
::* choose a suitable colour, such as red;&lt;br /&gt;
::* connect it to Port A, bit 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Flowcode program==&lt;br /&gt;
'''The plan:'''&lt;br /&gt;
* Set the initial position of the intruder, using the 'MoveTo' simulation macro.&lt;br /&gt;
&lt;br /&gt;
* Move the intruder towards the detection cone using the 'MoveAlong' simulation macro. &lt;br /&gt;
:: This '''changes''' the x coordinate of the intruder '''by an amount specified by the variable 'xpos''''. &lt;br /&gt;
&lt;br /&gt;
* When the intruder enters the detection zone, the simulation macro 'CollisionTest' returns a value of '1' in the variable 'hit'. &lt;br /&gt;
:: At this point, we can stop any more movement so that we can look at the x coordinate of the intruder. &lt;br /&gt;
:: To do so, we change the value of 'xpos' to zero.&lt;br /&gt;
&lt;br /&gt;
* Otherwise, the simulation repeats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Implementation:'''&lt;br /&gt;
&lt;br /&gt;
* [[Opening Flowcode|Open Flowcode]].&lt;br /&gt;
&lt;br /&gt;
* On the Startup screen, click on 'New project' to [[Creating Flowcharts|create a new flowchart]].&lt;br /&gt;
&lt;br /&gt;
* Add the icons shown in the flowchart:&lt;br /&gt;
:* a loop icon, configured as an infinite loop, and within it:&lt;br /&gt;
::* a Simulation macro icon[[File:Btn Simulation Macro.gif|border]];&lt;br /&gt;
::* a second loop;&lt;br /&gt;
::* a Calculation icon.&lt;br /&gt;
&lt;br /&gt;
:* Within the second loop, add:&lt;br /&gt;
::* two more Simulation macro icons;&lt;br /&gt;
::* a decision icon with:&lt;br /&gt;
:::* a 'Yes' loop containing an output icon, followed by a delay icon and then a calculation icon;&lt;br /&gt;
:::* a 'No' loop containing an output icon, followed by a delay icon;&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_SimIcon_Simmove.png|right|250px]]&lt;br /&gt;
&lt;br /&gt;
* Configure the icons, by double clicking on each in turn, as follows:&lt;br /&gt;
::* the top Simulation macro:&lt;br /&gt;
:::* name it &amp;quot;Set initial position&amp;quot;;&lt;br /&gt;
:::* click on the 'Panel' tab, and then on the 'Position' folder;&lt;br /&gt;
:::* click on the 'MoveTo' macro and:&lt;br /&gt;
::::* choose 'group2'(the intruder)as the Handle;&lt;br /&gt;
::::* set the X value to &amp;quot;200&amp;quot;;&lt;br /&gt;
::::* set the Y value to &amp;quot;0&amp;quot;;&lt;br /&gt;
::::* set the Z value to &amp;quot;28&amp;quot;;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::* the second loop:&lt;br /&gt;
:::* set it to 'Loop while:' &amp;quot;hit = 0&amp;quot;;&lt;br /&gt;
:::* 'Test the loop at the:' 'End'&lt;br /&gt;
:::* Click on OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_SimIcon_Moveint.png|right|350px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::* the second Simulation macro:&lt;br /&gt;
:::* name it &amp;quot;Move the intruder&amp;quot;;&lt;br /&gt;
:::* click on the 'Panel' tab, and then on the 'Position' folder;&lt;br /&gt;
:::* click on the 'MoveAlong' macro and:&lt;br /&gt;
::::* choose 'group2'(the intruder)as the Handle;&lt;br /&gt;
::::* choose 'shape1'( the brick wall) as the Axis;&lt;br /&gt;
::::* click on the down arrow on the end of the 'X' row, and create a floating point variable called &amp;quot;xpos&amp;quot;, with an initial value 5.0, to use as the X variable;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise SimIcon Simcheck.png|right|250px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::* the third Simulation macro:&lt;br /&gt;
:::* name it &amp;quot;Check detection&amp;quot;;&lt;br /&gt;
:::* click on the 'Panel' tab, and then on the 'Collision' folder;&lt;br /&gt;
:::* click on the 'TestSingle' macro and:&lt;br /&gt;
::::* choose 'shape2'(the detection cone) for 'Pos' and 'shape5' (the intruder's head,) for 'Test';&lt;br /&gt;
:::* use the down arrow at the end of the 'Return Value' box to create a boolean variable caled &amp;quot;hit&amp;quot; to use as the 'Return Value'.&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::* the decision icon:&lt;br /&gt;
:::* name it &amp;quot;Intruder detected?&amp;quot;;&lt;br /&gt;
:::* insert the condition &amp;quot;hit = 1&amp;quot;;&lt;br /&gt;
:::* click on OK.&lt;br /&gt;
&lt;br /&gt;
:::* In the 'Yes' loop:&lt;br /&gt;
::::* name the Output icon &amp;quot;Switch on lamp&amp;quot;;&lt;br /&gt;
::::* send value '1' to Port A single bit 0;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
::::* name the Delay icon &amp;quot;Wait 100ms&amp;quot;;&lt;br /&gt;
::::* configure it to give a delay of 100ms;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
::::* name the Calculation icon &amp;quot;Stop movement&amp;quot;;&lt;br /&gt;
::::* in the 'Calculations:' box, insert &amp;quot;xpos = 0&amp;quot; to reduce the distance incremented each time to zero;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
:::* In the 'No' loop:&lt;br /&gt;
::::* name the Output icon &amp;quot;Switch off lamp&amp;quot;;&lt;br /&gt;
::::* send value '0' to Port A single bit 0;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
::::* name the Delay icon &amp;quot;Wait 100ms&amp;quot;;&lt;br /&gt;
::::* configure it to give a delay of 100ms;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::* the final Calculation icon:&lt;br /&gt;
::::* name it &amp;quot;Reset variables&amp;quot;;&lt;br /&gt;
::::* in the 'Calculations:' box, insert &amp;quot;hit = 0&amp;quot; and &amp;quot;xpos = 5.0&amp;quot;;&lt;br /&gt;
::::* click on OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Flowcode flowchart resembles the one shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise SimIcon Simflow.png|center|500px]]&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
* Run the simulation.&lt;br /&gt;
: The intruder should move towards the house, until he enters the detection zone. &lt;br /&gt;
&lt;br /&gt;
: At this point, the warning lamp turns on and he stops for three seconds.&lt;br /&gt;
&lt;br /&gt;
: Then the simulation repeats.&lt;br /&gt;
&lt;br /&gt;
* Stop the simulation when the lamp is lit, and click on the image of the intruder. You can now read the x coordinate from the Panel properties box.&lt;br /&gt;
&lt;br /&gt;
* Change the height of the PIR sensor on the wall, or the angle of the detection cone, and see what happens to this coordinate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Simulation only==&lt;br /&gt;
The important point is that the Simulation macros do not compile to code that can be downloaded to a microcontroller. They affect only the simulation of the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Using Simulation Macros.fcfx|Exercise - Using Simulation Macros}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Analogue_Input_Devices&amp;diff=14337</id>
		<title>Exercise - Using Analogue Input Devices</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Analogue_Input_Devices&amp;diff=14337"/>
		<updated>2014-01-16T15:59:51Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: What Is a Component?&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
The aim of this exercise is to demonstrate the use of analogue input devices within a Flowcode flowchart.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Digital inputs are simpler to deal with, as they have a finite range of possible values.&amp;lt;br /&amp;gt;&lt;br /&gt;
For example, a two bit digital input can have one of only four possible values - 00, 01, 10 or 11.&amp;lt;br /&amp;gt;&lt;br /&gt;
Flowcode uses an 'Input' icon [[File:Btn Input.gif|border]] to deal with digital inputs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An analogue input, on the other hand can have any of an infinite number of possible values.&amp;lt;br /&amp;gt;&lt;br /&gt;
As a result, it is more difficult to handle in Flowcode.&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_System_Panel.png|300px|right]]&lt;br /&gt;
A component macro [[File:Btn Component Macro.gif|border]] is used to input data from an analogue sensor.&amp;lt;br /&amp;gt;&lt;br /&gt;
The data is then stored in a variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Component macros are sections of code that have been written to support the components included with Flowcode 6.&amp;lt;br /&amp;gt;&lt;br /&gt;
They take all the effort out of using these components.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this exercise, a warning lamp lights when the signal from an ADC dial device rises too far.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The flowchart sequence==&lt;br /&gt;
The flowchart will:&lt;br /&gt;
::::* Read the value set on the input device, the ADC dial.&lt;br /&gt;
::::* Compare this with a set value, and:&lt;br /&gt;
::::: if greater than the set value, turn on a lamp;&lt;br /&gt;
::::: if less, then make sure that the lamp is off.&lt;br /&gt;
::::* Loop back to the beginning, and repeat the process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_Variable_Manager.png|300px|right]]&lt;br /&gt;
==Create the 'input' variable==&lt;br /&gt;
:* In the 'Edit' menu, on the main toolbar, click on 'Variables...' to open the [[Variable Manager]] dialogue box.&lt;br /&gt;
::* Hover just to the left of the 'Variables' label, and click on the down arrow that appears.&lt;br /&gt;
::* Select 'Add new' and the 'Create a New Variable' dialogue box opens.&lt;br /&gt;
::* Name the new variable &amp;quot;input&amp;quot;.&lt;br /&gt;
::* Leave the variable type as 'Byte'.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::* The dialogue box is shown opposite.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Create the flowchart==&lt;br /&gt;
* Click and drag an infinite loop, [[File:Btn Loop.gif|border]] between the 'BEGIN' and 'END' icons.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_Component_Macro_Properties.png|300px|right]]&lt;br /&gt;
* Inside the loop:&lt;br /&gt;
:* Click and drag a 'Component macro' icon.[[File:Btn_Component_Macro.gif|border]]&lt;br /&gt;
::* Double click on it to open the dialogue box, so that you can configure it.&lt;br /&gt;
::: The program 'knows' which components you have added to the System or Dashboard panel, and modifies the list of available commands accordingly.&lt;br /&gt;
::: Under 'Components', the ADC dial will be listed, and underneath it the list of commands.&lt;br /&gt;
::* Scroll down the list and click on the 'GetByte' command.&lt;br /&gt;
::: This reads the output of the analogue input device - the ADC dial in this case, and stores it in the byte variable called 'input'.&lt;br /&gt;
::* Rename the 'Display name' as &amp;quot;Read the input&amp;quot;.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::* Again, the dialogue box is shown opposite.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Next, drag and drop a 'Decision' box, [[File:Btn Decision.gif|border]] and double click on it to open the dialogue box.&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_Decision_Properties.png|300px|right]]&lt;br /&gt;
:* Rename it &amp;quot;Compare it !&amp;quot;&lt;br /&gt;
:* In the condition 'If' box, type &amp;quot;input&amp;gt;128&amp;quot;.&lt;br /&gt;
:: The '128' is totally arbitrary in this program. A byte variable can store any value from 0 to 255, so 128 is roughly half way.&lt;br /&gt;
:: In this case, the program decides whether the value stored in the variable 'input' is greater or smaller than 128, and reacts differently depending on that decision.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
::* Again, the resulting dialogue box is shown opposite.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_Output_Properties_01.png|300px|right]]&lt;br /&gt;
* In the 'Yes' branch, drag and drop an 'Output' icon, [[File:Btn Output.gif|border]].&lt;br /&gt;
:* Double click on it to open the dialogue box.&lt;br /&gt;
:* Change the 'Display name:' to &amp;quot;Switch on the lamp&amp;quot;.&lt;br /&gt;
:* In the 'Variable or value:' box, type &amp;quot;1&amp;quot;.&lt;br /&gt;
:* Configure the rest of the box to output this to 'PORT A' 'Single Bit:' 0.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_Output_Properties_02.png|300px|right]]&lt;br /&gt;
* In the 'No' branch, drag and drop a second 'Output' icon.&lt;br /&gt;
:* Double click on it to open the dialogue box.&lt;br /&gt;
:* Change the 'Display name:' to &amp;quot;Switch off the lamp&amp;quot;.&lt;br /&gt;
:* In the 'Variable or value:' box, type &amp;quot;0&amp;quot;.&lt;br /&gt;
:* Configure the rest of the box to output this to 'PORT A' 'Single Bit:' 0.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
::* Again, the dialogue boxes for the 'Output' icons are shown opposite.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flowchart should now resemble the one shown below.&lt;br /&gt;
[[File:Exercise_Using_Analogue_Input_Devices_Flowchart.png|300px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the LED==&lt;br /&gt;
* Locate an [[Component: ID a7b05886 784c 48c8 a6f6 cc371c7728e1|LED]] such as the [[Component: ID 7fdaec78 394e 4ec9 a578 4f1a12a12076|LED 5mm Panel]] in the 'Outputs' toolbox in the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
:* Hover over the image to the left of the component label 'LED 5mm Panel', and click on the down-arrow that appears.&lt;br /&gt;
:* Click on the 'Add to system panel' option to select it.&lt;br /&gt;
:* Select the LED on the System panel and drag it to a suitable position.&lt;br /&gt;
:* Look at the Panel Properties, the 'Connection' property make sure that it is connected to Port A, bit 0 ($PORTA.0).&lt;br /&gt;
:: Leave it like this.&lt;br /&gt;
&lt;br /&gt;
==Add the ADC dial==&lt;br /&gt;
The ADC dial represents a number of input devices.&lt;br /&gt;
* Locate the 'ADC dial' in the 'Inputs' toolbox in the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
:* Hover over the image to the left of the label, and click on the down-arrow that appears.&lt;br /&gt;
:* Click on the 'Add to system panel' option to select it.&lt;br /&gt;
:* Select the ADC dial on the System panel and drag it to a suitable position.&lt;br /&gt;
:* Look at the Panel Properties, and locate the 'Connection' property. Just below it, the 'Channel' property shows that, by default, it is connected to 'AN0' - the first bit of the microcontroller capable of accepting an analogue input. Click on 'AN0' to open a pinout of the microcontroller.&lt;br /&gt;
::* Click on the rectangle representing input 'AN1' to change the connection to this channel.&lt;br /&gt;
:: Leave it like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The System Panel should resemble the image shown at the top of the page.&lt;br /&gt;
&lt;br /&gt;
==Final testing==&lt;br /&gt;
* Save the flowchart as 'Analogue,fcf'.&lt;br /&gt;
* Click on the simulation button [[File:Btn Run.png|border]].&lt;br /&gt;
* Use the mouse to turn the pointer on the ADC dial, and notice what happens when you pass the half-way mark.&lt;br /&gt;
* Click on the 'Stop simulation' button, [[File:Btn Stop.png|border]] when you are happy with the program's behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Using Analogue Input Devices.fcfx|Exercise - Using Analogue Input Devices}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Component_Macros&amp;diff=14338</id>
		<title>Exercise - Using Component Macros</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Using_Component_Macros&amp;diff=14338"/>
		<updated>2014-01-16T15:59:51Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: What Is a Macro?&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Component macros are sections of code that have been written to support the components included with Flowcode 6.&amp;lt;br /&amp;gt;&lt;br /&gt;
They take all the effort out of using these components.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This exercise uses them to control a particularly complicated, but very common device, the Liquid Crystal Display (LCD).&amp;lt;br /&amp;gt;&lt;br /&gt;
In this case, it uses a LCD to display elapsed time in a timer.&lt;br /&gt;
&lt;br /&gt;
The first section looks at using [[Component Macro Icon Properties|Component Macros]] to create the core timing sequence. The second section looks at using it to turn on a lamp for ten seconds once a switch is pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==The core timing sequence==&lt;br /&gt;
At the core of the program is a section that sets up the LCD to display the time.&amp;lt;br /&amp;gt;&lt;br /&gt;
The flowchart sequence for displaying the elapsed time will be:&lt;br /&gt;
::::* Initialize the LCD using the 'Start' macro.&lt;br /&gt;
::::* Set the cursor position in the LCD, using the 'Cursor' macro.&lt;br /&gt;
::::* Display the text &amp;quot;Elapsed time&amp;quot;, using the 'PrintString' macro.&lt;br /&gt;
::::* Set the time to zero.&lt;br /&gt;
::::* Change the cursor position, using the 'Cursor' macro.&lt;br /&gt;
::::* Display the time.&lt;br /&gt;
::::* Wait for one second.&lt;br /&gt;
::::* Increment the time.&lt;br /&gt;
::::* Display the new time.&lt;br /&gt;
::::* Loop back and repeat the process from the one second delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Set up the flowchart===&lt;br /&gt;
* Open Flowcode, and set up the new flowchart as described in [[Exercise - Creating a Flowchart|Creating a Flowchart]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Create the core sequence===&lt;br /&gt;
===Add the LCD===&lt;br /&gt;
* Locate the 'LCD' inside the 'Outputs' toolbox in the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
:* Hover over the image to the left of the 'LCD' label, and click on the down-arrow that appears.&lt;br /&gt;
:* Click on the 'Add to system panel' option to select it.&lt;br /&gt;
:* Zoom in until the LCD image is big enough to read. (See [[Exercise - Controlling the Camera]] for information on how to zoom in on the [[System Panel]].)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Initialise the LCD===&lt;br /&gt;
* Click and drag an infinite loop between the 'BEGIN' and 'END' icons.&lt;br /&gt;
* Inside the loop:&lt;br /&gt;
:* Click and drag a 'Component macro' icon.[[File:Btn_Component_Macro.gif|border]]&lt;br /&gt;
::* Double click on it to open the dialogue box, so that you can configure it.&lt;br /&gt;
::: The program 'knows' which components you have added to the System or Dashboard panel, and modifies the list of available commands accordingly.&lt;br /&gt;
::: Under 'Components', the LCD will be listed, and underneath it the list of commands.&lt;br /&gt;
::* Scroll down to the bottom of the list and click on the 'Start' command.&lt;br /&gt;
::* Rename the 'Display name' as &amp;quot;Start the LCD&amp;quot;.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::* The dialogue box is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Set up the display===&lt;br /&gt;
The first task is to define where the text will be displayed.&amp;lt;br /&amp;gt;&lt;br /&gt;
This involves another LCD 'Component Macro' called 'Cursor'.&lt;br /&gt;
This defines the LCD 'cell' where the text display starts. The LCD has a grid of 32 cells, arranged in 2 rows of 16.&amp;lt;br /&amp;gt;&lt;br /&gt;
The upper row is given the value y=0, and the lower y=1. The sixteen horizontal cells are given values from x=0 to x=15.&lt;br /&gt;
:* Click and drag a second 'Component macro' icon just below the first.&lt;br /&gt;
::* Double click on it to open the dialogue box.&lt;br /&gt;
::* Scroll down to the 'Cursor' command.&lt;br /&gt;
::* Rename the 'Display name' as &amp;quot;Move the cursor&amp;quot;.&lt;br /&gt;
::* In the 'Parameters' section, set the value of 'x' to 2, and 'y' to 0.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
The next 'Component Macro' specifies the text to be printed, starting at this location.&lt;br /&gt;
:* Click and drag a third 'Component macro' icon just below the first.&lt;br /&gt;
::* Double click on it to open the dialogue box.&lt;br /&gt;
::* Scroll down to the 'PrintString' command and click on it.&lt;br /&gt;
::* Rename the 'Display name' as &amp;quot;Elapsed time&amp;quot;.&lt;br /&gt;
::* In the 'Expression' box, type &amp;quot;Elapsed time&amp;quot; (making sure you include the quotation marks &amp;quot;&amp;quot;.)&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::* The dialogue box is shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Using_Component_Macros_Variable_Properties.png|250px|right]]&lt;br /&gt;
===Display elapsed time===&lt;br /&gt;
:* In the 'Edit' menu, on the main toolbar, click on 'Variables...' to open the [[Variable Manager]] dialogue box.&lt;br /&gt;
::* Hover just to the left of the 'Variables' label, and click on the down arrow that appears.&lt;br /&gt;
::* Select 'Add new' and the 'Create a New Variable' dialogue box opens.&lt;br /&gt;
::* Name the new variable &amp;quot;time&amp;quot;, and give it an initial value of zero.&lt;br /&gt;
::* Leave the variable type as 'Byte'.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::* The dialogue box is shown below.&lt;br /&gt;
&lt;br /&gt;
: The next Component Macro repositions the cursor, so that the elapsed time is shown below the &amp;quot;Elapsed time&amp;quot; label.&amp;lt;br /&amp;gt;&lt;br /&gt;
: The y value is changed to y=1, and the x value to x=8.&lt;br /&gt;
:* Click and drag a fourth 'Component Macro' to follow the third one.&lt;br /&gt;
::* Double click on it to open the dialogue box.&lt;br /&gt;
::* Scroll down to the 'Cursor' command.&lt;br /&gt;
::* Rename the 'Display name' as &amp;quot;Move the cursor&amp;quot;.&lt;br /&gt;
::* In the 'Parameters' section, set the value of 'x' to 8, and 'y' to 1.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
:* Click and drag a fifth 'Component macro' icon just below the fourth.&lt;br /&gt;
::* Double click on it to open the dialogue box.&lt;br /&gt;
::* Scroll down to the 'PrintNumber' command and click on it.&lt;br /&gt;
::* Rename the 'Display name' as &amp;quot;Display elapsed time&amp;quot;.&lt;br /&gt;
::* In the 'Expression' box, type the variable name &amp;quot;time&amp;quot;.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::* The fifth 'Component Macro' dialogue box is shown below.&lt;br /&gt;
&amp;lt;gallery widths=200px heights=200px perrow=5 caption=&amp;quot;Component Macro Properties&amp;quot;&amp;gt;&lt;br /&gt;
File:Exercise_Using_Component_Macros_Icon_Properties_01.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Icon_Properties_04.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Icon_Properties_02.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Icon_Properties_05.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Icon_Properties_03.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Finishing touches===&lt;br /&gt;
:* Click and drag a 'Delay' icon to follow the fifth 'Component Macro'.&lt;br /&gt;
::* Double click on it to open the dialogue box.&lt;br /&gt;
::* Rename it &amp;quot;Wait one second.&amp;quot;&lt;br /&gt;
::* Configure it to give a delay of one second.&lt;br /&gt;
::: For help with 'Delay' icons, see [[Icon Properties]]&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:* Click and drag a 'Calculation' icon to follow the 'Delay'.&lt;br /&gt;
::* Double click on it to open the dialogue box.&lt;br /&gt;
::* Rename it &amp;quot;Add one second.&amp;quot;&lt;br /&gt;
::* In the 'Calculations:' section, type &amp;quot;time=time+1&amp;quot;.&lt;br /&gt;
::: The effect of this is to increase the number stored in the 'time' variable by one, (also called incrementing the 'time' variable.)&lt;br /&gt;
::: For help with 'Calculation' icons, see [[Icon Properties]]&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Test the Core===&lt;br /&gt;
: The diagram below shows the flowchart at this stage.&lt;br /&gt;
[[File:Exercise_Using_Component_Macros_Flowchart_01.png|350px|center]]&lt;br /&gt;
: At this point, the flowchart should be saved as 'Timer', and can be simulated to test it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Extend the program==&lt;br /&gt;
The full program is designed to:&lt;br /&gt;
:::: wait until a switch is pressed momentarily;&lt;br /&gt;
:::: light a lamp ;&lt;br /&gt;
:::: time a ten second period;&lt;br /&gt;
:::: then switch it off.&lt;br /&gt;
&lt;br /&gt;
To do this, the sequence is now modified, as follows:&lt;br /&gt;
:* Is the switch pressed?&lt;br /&gt;
::* If not, branch back and test the switch again.&lt;br /&gt;
::* If it has:&lt;br /&gt;
:::* light the lamp;&lt;br /&gt;
:::* run through the timing core ten times,&lt;br /&gt;
:::* switch off the lamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Add the switch===&lt;br /&gt;
* Locate the 'Push Round Panel' switch in the 'Inputs' toolbox in the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
:* Hover over the image to the left of the switch label, and click on the down-arrow that appears.&lt;br /&gt;
:* Click on the 'Add to system panel' option to select it.&lt;br /&gt;
:* Click on the image of the switch on the System panel to select it and drag it to a suitable position.&lt;br /&gt;
:* On the Panel Properties, click on the 'Unconnected' label, next to 'Connection'.&lt;br /&gt;
:: A pinout of the microcontroller appears.&lt;br /&gt;
:* Click on the rectangle that represents the pin RA1/AN1, to connect the switch to Port A, bit 1 of the microcontroller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Add the LED===&lt;br /&gt;
* Locate and LED such as the 'Single LED' or 'LED 5mm Panel' in the 'Outputs' toolbox in the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
:* Hover over the image to the left of the component label (e.g. 'Single LED' and 'LED 5mm Panel), and click on the down-arrow that appears.&lt;br /&gt;
:* Click on the 'Add to system panel' option to select it.&lt;br /&gt;
:* Select the LED on the System panel and drag it to a suitable position.&lt;br /&gt;
:* Look at the Panel Properties, the 'Connection' property shows that, by default, it is connected to Port A, bit 0.&lt;br /&gt;
:: Leave it like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Modify the flowchart===&lt;br /&gt;
* Immediately after the 'Begin' icon, drag and drop a 'Connection Point (Declare Connection Point)' icon.[[File:Btn Connection Point.gif|border]]&lt;br /&gt;
* Next, add an 'Input' icon, and double click on it to open the dialogue box.&lt;br /&gt;
* Change the 'Display name:' to &amp;quot;Read the switch&amp;quot;.&lt;br /&gt;
* Create a new variable, called 'switch'. One way to do this is to click on the down arrow at the end of the 'Variable:' box.&lt;br /&gt;
:* Then click on the down arrow next to the 'Variables' label, and select 'Add new'.&lt;br /&gt;
:* The 'Create a New Variable' dialogue box opens. Type in &amp;quot;switch&amp;quot; as the name of the new variable. Leave the variable type as 'Byte'.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
* In the 'Variable' box, type the name of the new variable &amp;quot;switch&amp;quot;.&lt;br /&gt;
* In the 'Port:' box, select 'PORT A'. Configure the rest of the dialogue box to 'Input from:' 'Single Bit:' 1.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
* Next, drag and drop a 'Decision' box, and double click on it to open the dialogue box.&lt;br /&gt;
:* Rename it &amp;quot;Switch pressed?&amp;quot;.&lt;br /&gt;
:* In the condition 'If' box, type &amp;quot;switch=1&amp;quot;&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
* In the 'No' branch, drag and drop a 'Connection Point (Jump to Connection Point)' icon.[[File:Btn Goto Connection Point.gif|border]]&lt;br /&gt;
* In the 'Yes' branch, drag and drop an 'Output' icon.&lt;br /&gt;
:* Double click on it to open the dialogue box.&lt;br /&gt;
:* Change the 'Display name:' to &amp;quot;Switch on the lamp&amp;quot;.&lt;br /&gt;
:* In the 'Variable or value:' box, type &amp;quot;1&amp;quot;.&lt;br /&gt;
:* Configure the rest of the box to output this to 'PORT A' 'Single Bit:' 0.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
* Click and drag the 'Loop' icon to follow this in the 'Yes' branch.&lt;br /&gt;
:* Double click on the 'Loop' icon to configure it.&lt;br /&gt;
:* Leave the 'Display name:' as 'Loop', and the 'Loop while:' box checked.&lt;br /&gt;
:* In the other box, type the condition &amp;quot;time&amp;lt;10&amp;quot;.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
* After the end of the loop, drag and drop a second 'Output' icon.&lt;br /&gt;
:* Double click on it, rename it &amp;quot;Switch off the lamp&amp;quot; and configure it to output value 0 to Port A, bit 0.&lt;br /&gt;
:* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The dialogue boxes for all these additions are shown below.&lt;br /&gt;
&amp;lt;gallery widths=200px heights=200px perrow=5 caption=&amp;quot;Added Component Macro Properties&amp;quot;&amp;gt;&lt;br /&gt;
File:Exercise_Using_Component_Macros_Input_Properties_01.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Decision_Properties_01.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Output_Properties_01.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Loop_Properties_01.png&lt;br /&gt;
File:Exercise_Using_Component_Macros_Output_Properties_02.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The final flowchart resembles the one below.&lt;br /&gt;
[[File:Exercise_Using_Component_Macros_Flowchart_02.png|350px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Final testing==&lt;br /&gt;
* [[Saving a Flowchart|Save the flowchart]].&lt;br /&gt;
* [[Starting Flowchart Simulation|Run the simulation]] to test that it works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Using Component Macros.fcfx|Exercise - Using Component Macros}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_System_Panel_-_Adding_Objects&amp;diff=14335</id>
		<title>Exercise - System Panel - Adding Objects</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_System_Panel_-_Adding_Objects&amp;diff=14335"/>
		<updated>2014-01-16T15:59:50Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Panel Exercises&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
This exercise starts the process of building the display panel for a car. It sets up the System Panel, with a warning LED.&amp;lt;br /&amp;gt; '''Although specific settings are given, you should play around with alternatives to see the effect.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==New flowchart==&lt;br /&gt;
* [[Creating Flowcharts|Start a new Flowcode flowchart]], using the default microcontroller.&lt;br /&gt;
&lt;br /&gt;
* Make sure that the [[System Panel]] is visible. If necessary, click on [[View]] and then select 'System Panel' a check-box will appear next to the option when enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General options==&lt;br /&gt;
* Click on the 'General options' tab [[File:Gen Panel General Options 01.png|border]]&lt;br /&gt;
: Make the following changes:&lt;br /&gt;
::* Move the 'Level of detail' slider fully to the right (to '10').&lt;br /&gt;
::* Select 'Table top' shadow mode.&lt;br /&gt;
::* Choose a 'Background' style of 'Solid color' and set the background color to dark blue, (Red=0, Green=0, Blue=128 on the 'Custom' tab.)&lt;br /&gt;
::* Set the 'Table top' size to '20'.&lt;br /&gt;
::* Choose a 'Table top' style of 'Solid color' and set its color to light blue, (Red=0, Green=70, Blue=255 on the 'Custom' tab.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Grid and snap options==&lt;br /&gt;
* Click on the 'Grid and Snap options' tab [[File:Gen Panel Tools 01.png|border]]&lt;br /&gt;
: Make the following changes:&lt;br /&gt;
::* Set it to snap to the 'Table top', by clicking on the check-box next to the 'Table top' label.&lt;br /&gt;
::* Leave the 'Show' gridlines box unchecked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the LED==&lt;br /&gt;
[[File:Gen_Inputs_Components_Toolbar_01.png|right]]&lt;br /&gt;
* Click on the 'Outputs' toolbox and locate an LED such as the 'LED 5mm Panel' component.&lt;br /&gt;
&lt;br /&gt;
* Click on the down-arrow next to the component label and then on 'Add to system panel'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Right click anywhere on the System Panel and select the 'Zoom to 100%' option.&lt;br /&gt;
: The System Panel should now resemble the one shown below.&lt;br /&gt;
[[File:Gen_System_Panel_LED_5mm_01.png|center|333x311px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Change the LED properties==&lt;br /&gt;
* Click on the LED to select it. &lt;br /&gt;
: In the Panel Properties, two properties appear for the LED - 'color' and 'pin'.&lt;br /&gt;
&lt;br /&gt;
* The 'color' property is set as red (0x0000FF). Click on this value, and change it to orange (0x0080FF).&lt;br /&gt;
: You may see very little change in the appearance of the LED, as currently it is turned off.&lt;br /&gt;
&lt;br /&gt;
* The 'pin' property determines which pin of the microcontroller the LED is connected to.&lt;br /&gt;
: Currently, this is $PORTA,0 (pin 0 of PORTA). Click on the label. A pinout of the microcontroller appears. &lt;br /&gt;
: Click on bit 1 (RA1/AN1) to change this connection.&lt;br /&gt;
&lt;br /&gt;
* The Panel Properties also gives information about the size and position of the LED. &lt;br /&gt;
: By default, size is shown in terms of 'Scale'. &lt;br /&gt;
: Hover the cursor over the folder icon next to the 'Scale' label, and then click on the down-arrow that appears.&lt;br /&gt;
: Select 'World size'.&lt;br /&gt;
&lt;br /&gt;
* Click on the 'Width' setting, (which may be shortened to 'Wi...'). Change it to 10mm.&lt;br /&gt;
&lt;br /&gt;
* In similar fashion, change the 'Height' ('He...') to 10mm and the 'Depth' ('De...') to 5mm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Zoom in==&lt;br /&gt;
* As a result, the LED now looks very small on the System Panel.&lt;br /&gt;
: You can zoom in to make it look larger. To do this:&lt;br /&gt;
: Hold down the control 'Ctrl' key on the keyboard. The 'zoom' icon appears. [[File:Gen Panel Camera Zoom 01.png]]&lt;br /&gt;
: Move the cursor over this icon. Now when you move the cursor up the screen, the view zooms in, and when you move it down, it zooms out.&lt;br /&gt;
: Adjust the zoom so that the 'Table top' fills most of the [[System Panel]], making the LED more visible.&lt;br /&gt;
&lt;br /&gt;
==Switch on==&lt;br /&gt;
* Click and drag an 'Output' icon to your flowchart.&lt;br /&gt;
: Double-click on it and change the 'Variable or value' setting from '0' to '255'.&lt;br /&gt;
: This sends a logic 1 signal to all pins of PORT A.&lt;br /&gt;
: The flowchart resembles the one below:&lt;br /&gt;
[[File:gen_exerciseSystemPaneladdobjects_outputprops_01.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:gen_exerciseSystemPaneladdobjects_runicon_01.png|200px|right]]&lt;br /&gt;
* Run the simulation, by clicking on the 'Run' icon shown opposite. &lt;br /&gt;
&lt;br /&gt;
: The LED will 'turn on'.&lt;br /&gt;
&lt;br /&gt;
* Double-click on the 'Output' icon again, and change the value to '0'.&lt;br /&gt;
: Now when you simulate the flowchart, the LED will turn off.&lt;br /&gt;
&lt;br /&gt;
* Save the flowchart as &amp;quot;System_Panel_Add_LED&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - System Panel - Adding Objects.fcfx|Exercise - System Panel - Adding Objects}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What next==&lt;br /&gt;
The next stage is to mount the LED on the instrument panel. This is covered in the exercise [[Exercise - System Panel - Controlling Shapes|controlling shapes]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Video instructions==&lt;br /&gt;
&lt;br /&gt;
See the [http://www.youtube.com/watch?v=2yT5XTLLX6o&amp;amp;list=PLQDWBb7bxuCgg6aJgPJcfXBMzZdLILceQ Adding Objects to the Panel] video for a demonstration and explanation about adding components and objects to the System Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
{{#ev:youtube|2yT5XTLLX6o|640}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_System_Panel_-_Controlling_Collisions&amp;diff=14336</id>
		<title>Exercise - System Panel - Controlling Collisions</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_System_Panel_-_Controlling_Collisions&amp;diff=14336"/>
		<updated>2014-01-16T15:59:50Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Panel Exercises&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
This exercise looks at ways in which two objects interact on the [[System Panel]].&amp;lt;br /&amp;gt;&lt;br /&gt;
It does not design a flowchart, but looks at configuring the collision control icon found on the System Panel.&amp;lt;br /&amp;gt;&lt;br /&gt;
The images below are intended to illustrate the differences between the collision settings, but screen shots are limited in what they can convey when motion is involved. &amp;lt;br /&amp;gt;This is really a hands-on exercise - you have to see and feel the difference!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set up the Flowcode flowchart==&lt;br /&gt;
&lt;br /&gt;
* [[Creating Flowcharts|Create a new flowchart]], accepting the default microprocessor.&lt;br /&gt;
* Make sure that the System Panel is visible, using the [[View]] menu if necessary.&lt;br /&gt;
* Click on the 'General options' icon to configure the System Panel. [[File:Gen Panel General Options 01.png|border]]&lt;br /&gt;
:* Select suitably contrasting colors for the 'Table top', (e.g. light blue - red=160, green=192, blue=255,) and 'Background', (e.g. mid-blue - red=0, green=0, blue=192.)&lt;br /&gt;
:* Select three views in the 'Number of views:' options.&lt;br /&gt;
:* Click on the red, green and blue arrowheads in turn, to produce the views shown below.&lt;br /&gt;
* Click on the 'Grid and Snap options' tab [[File:Gen Panel Tools 01.png|border]]&lt;br /&gt;
:* Uncheck all 'Snap to' options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Start position==&lt;br /&gt;
* Drag and drop a cube onto the System Panel.&lt;br /&gt;
:* Give it 'Coordinates' X=0, Y=0, Z=16 to make it sit on the 'Table top'.&lt;br /&gt;
:* Leave it as the default color it - red (red=192, green=0, blue=0).&lt;br /&gt;
* Drag and drop a sphere onto the System Panel.&lt;br /&gt;
:* Give it 'Coordinates' X=-60, Y=60, Z=16 to make it sit on the 'Table top' at the top left corner.&lt;br /&gt;
:* Color it green (e.g. red=0, green=192, blue=0).&lt;br /&gt;
* Look at all three views. Make sure that you understand what each shows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:gen_exercisecollisioncontrol_start.png|800px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Collision type - Move through==&lt;br /&gt;
[[File:gen_exercisecollisioncontrol_icon_01.png|100px|left]]&lt;br /&gt;
* Click on the 'Collision Control' icon, and select 'Move through'.&lt;br /&gt;
* Move the sphere towards the cube, and make the two overlap.&lt;br /&gt;
: The two objects coalesce when they meet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:gen_exercisecollisioncontrol_through_01.png|800px|center]]&lt;br /&gt;
* Move the sphere back to its start position.&lt;br /&gt;
: The objects re-emerge as separate items.&amp;lt;br /&amp;gt;&lt;br /&gt;
: This setup would be useful when an object is allowed to enter a marked zone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Collision type - Move over==&lt;br /&gt;
* Click on the 'Collision Control' icon, and select 'Move over'.&lt;br /&gt;
* Once again, move the sphere towards the cube so that they collide.&lt;br /&gt;
: Notice the difference - this time the sphere jumps over the cube.&lt;br /&gt;
: This is where the three views are really useful.&lt;br /&gt;
: Look at each, and make sure that you understand exactly what is happening.&lt;br /&gt;
[[File:gen_exercisecollisioncontrol_over_01.png|800px|center]]&lt;br /&gt;
* Move the sphere back to its start position.&lt;br /&gt;
&lt;br /&gt;
==Collision type - Move around==&lt;br /&gt;
* Click on the 'Collision Control' icon, and select 'Move around'.&lt;br /&gt;
* Again, move the sphere towards the cube so that they collide.&lt;br /&gt;
: Notice the difference!&lt;br /&gt;
: Again, use the three views to see exactly what is happening.&lt;br /&gt;
&lt;br /&gt;
[[File:gen_exercisecollisioncontrol_around_01.png|800px|center]]&lt;br /&gt;
&lt;br /&gt;
In the last two cases, the objects retained their separate identities during the collision, but had different degrees of freedom.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - System Panel - Controlling Collisions.fcfx|Exercise - System Panel - Controlling Collisions}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Inserting_Code_Into_Flowcode&amp;diff=14334</id>
		<title>Exercise - Inserting Code Into Flowcode</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Inserting_Code_Into_Flowcode&amp;diff=14334"/>
		<updated>2014-01-16T15:59:48Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: What Is an Interrupt?&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
C code is a high-level programming language widely used in industry.&amp;lt;br /&amp;gt;&lt;br /&gt;
It has spawned a number of other programming languages, such as C#, C++, Java and Python. &lt;br /&gt;
&lt;br /&gt;
Flowcode programs are first compiled into C before being crunched down eventually into hex code. &lt;br /&gt;
&lt;br /&gt;
There are two mechanisms for adding your own C code to a Flowcode flowchart:&lt;br /&gt;
[[File:Exercise_InsCode_C_suppcode.jpg|right|350px]]&lt;br /&gt;
* using the 'C Code' icon   [[File:Btn C Code.gif|border]] ;&lt;br /&gt;
* using the 'Use supplementary code' facility within 'Project Options', shown opposite:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Why would you want to?==&lt;br /&gt;
&lt;br /&gt;
* Flowcode programs are compiled to 'C', but produce many lines of code. &lt;br /&gt;
: They do so because they must be able to cope with any function or structure that the designer wishes to use. &lt;br /&gt;
: Experienced C programmers may wish to use code more efficiently, and so insert a few lines of code to replace many lines which Flowcode would generate. (This usually applies to the 'Adding supplementary code' option.)&lt;br /&gt;
&lt;br /&gt;
* Experienced programmers can insert a short section of C code in order to reduce the length, or complexity, of the Flowcode program.&lt;br /&gt;
&lt;br /&gt;
* Students learning to program in C can test short sections of code by inserting them into a Flowcode program. This avoids having to write the full program in C.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Adding supplementary code==&lt;br /&gt;
&lt;br /&gt;
This feature is used when you have blocks of code containing routines, definitions, lookup tables, etc.  &lt;br /&gt;
[[File:Gen_Supplementary_Code_01.png|right|frameless]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Definitions and function declarations:'''&lt;br /&gt;
&lt;br /&gt;
This is the first section. It allows users to initialise the program, by adding structures such as 'defines', 'includes', and other function declarations.  This section must be placed at the beginning of the C file so that the code is 'visible' to all parts of the program.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''Function implementations:'''&lt;br /&gt;
&lt;br /&gt;
This second section allows for the addition of the main function code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Structured thus, the code is accessible to any Flowcode macro, and vice-versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Warning==&lt;br /&gt;
&lt;br /&gt;
Be sure that the added C code is correct! &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flowcode does not simulate C Code, so programs that make use of supplementary code may not simulate correctly. &lt;br /&gt;
Where Flowcode fails to compile, it may be that the supplementary code contains errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Using the 'Code' icon==&lt;br /&gt;
[[File:Exercise_InsCode_C_Flowchart.png|right|294x261px]]&lt;br /&gt;
&lt;br /&gt;
* [[Opening Flowcode|Open Flowcode]].&lt;br /&gt;
&lt;br /&gt;
* On the Startup screen, click on 'New project' to [[Creating Flowcharts|create a new flowchart]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Add the icons shown in the flowchart:&lt;br /&gt;
::* a loop icon, configured as an infinite loop;&lt;br /&gt;
::* a calculation icon:&lt;br /&gt;
:::* use it to create two byte variables, 'var1' and 'add',&lt;br /&gt;
:::* set them to the following values:&lt;br /&gt;
::::: var1 = 2, add = 3;&lt;br /&gt;
::* a Code icon [[File:Btn C Code.gif|border]]- details given below;&lt;br /&gt;
::* a delay icon configured to give a two second delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The C Code==&lt;br /&gt;
&lt;br /&gt;
Configure the Code icon by typing in the following code, exactly as written here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;brush:[cpp]&amp;quot; style=&amp;quot;float:left;&amp;quot;&amp;gt;&lt;br /&gt;
trisb = 0;                         //Set all of Port B to output &lt;br /&gt;
portb = FCV_VAR1;                  //Output the value of var1 to port B&lt;br /&gt;
trisa = 1;                         //Convert port A bit 0 to input&lt;br /&gt;
if (test_bit(porta,0))             //Check to see if A0 is highelse&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The 'Code' icon properties box resembles that shown opposite.&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_InsCode_C_Code_Properties.png|center]]&lt;br /&gt;
&lt;br /&gt;
The software recognizes instructions and comments, and colour-codes them accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Some notes on this code:'''&lt;br /&gt;
&lt;br /&gt;
* The ports on the PIC chip are bi-directional - they can act as either input or output.&lt;br /&gt;
* Their behaviour is controlled by the contents of two more registers - TRISA (for Port A) and TRISB (for Port B.)&lt;br /&gt;
:* A value of '0' in the control register makes the corresponding bit of the port into an output bit.&lt;br /&gt;
:* A value of '1' in the control register makes the corresponding bit of the port into an input bit.&lt;br /&gt;
* Commands are finished by adding a semicolon (;).&lt;br /&gt;
* The characters '//' are used to indicate comments - there to aid understanding of the program. These are ignored by the compiler.&lt;br /&gt;
* Where variables are defined in the Flowcode program, the prefix 'FCV_' must be added to the name of the variable, which is written in upper case lettering.&lt;br /&gt;
* The 'if-else' construction examines a possible condition - &amp;quot;Is Port A bit 0 high?&amp;quot;&lt;br /&gt;
:* If true, the values of the two variables are added together and sent to Port B.&lt;br /&gt;
:* If false, only the value of 'var1' is sent to Port B.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* All of this could have been done using 'pure' Flowcode, but it would have required around five more icons in the flowchart.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
As pointed out earlier, Flowcode will not simulate added C code, and so there is no value in simulating this program.&amp;lt;br /&amp;gt;&lt;br /&gt;
Instead, compile it to the PIC chip which you specified as the target.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add the following E-Blocks units to the EB-008 Multiprogrammer holding the PIC chip:&lt;br /&gt;
:: a switch unit to Port A,&lt;br /&gt;
:: a LED unit to Port B.&lt;br /&gt;
Press the reset switch on the Multiprogrammer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Test the program by noticing the output displayed on the LEDs when switch 0 on the switch unit is pressed.&lt;br /&gt;
* When pressed, LEDs D2 and D0 should light, indicating an output 0101 (i.e. the number 5,)&lt;br /&gt;
* When not pressed, LED D1 should light, indicating an output 0010, (i.e. the number 2.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Inserting Code Into Flowcode.fcfx|Exercise - Inserting Code Into Flowcode}}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Creating_a_Flowchart&amp;diff=14331</id>
		<title>Exercise - Creating a Flowchart</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Creating_a_Flowchart&amp;diff=14331"/>
		<updated>2014-01-16T15:59:06Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: What Is a Flowcode Flowchart?&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
The task is to produce a Flowcode flowchart which will set the base of a program that will (when configured and programmed correctly) light a lamp for ten seconds when a switch is pressed. Note that we will not be configuring the flowchart icons to function in this exercise, we are just setting up the base to be expanded upon.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Although it may not be realistic to use a microcontroller in such a straight-forward application, it illustrates the technique of producing a Flowcode program.&amp;lt;br /&amp;gt;&lt;br /&gt;
The program itself may form part of a bigger program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Formulate the sequence==&lt;br /&gt;
The flowchart sequence will be:&lt;br /&gt;
: Check if the switch is pressed.&lt;br /&gt;
:: If it isn't, go back to the beginning.&lt;br /&gt;
:: If it is:&lt;br /&gt;
::: Switch on the lamp;&lt;br /&gt;
::: Wait for 10 seconds;&lt;br /&gt;
::: Switch off the lamp;&lt;br /&gt;
::: Go back to the beginning.&lt;br /&gt;
&lt;br /&gt;
It takes such a short time for the microcontroller to carry this out, that we don't need to worry whether the switch latches on or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set up the flowchart==&lt;br /&gt;
[[File:Gen_Startup_Selection.png||250px|right]]&lt;br /&gt;
* [[Opening Flowcode|Open Flowcode]].&lt;br /&gt;
* On the Startup screen, click on 'New project'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gen_Project_Options_Target_SIM.png|right|250px]]&lt;br /&gt;
: The [[Project Options]] dialogue box opens. &lt;br /&gt;
: (Click on the link for a full explanation of all the options available.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Accept the default settings by clicking on 'OK'.&lt;br /&gt;
: An empty flowchart window opens, which may contain other items such as a [[System Panel]], [[Dashboard Panel]], [[Properties Panel]] etc.&lt;br /&gt;
: These can be revealed or hidden using the [[View]] menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Set up the flowchart window so that you can see the System Panel and the Properties Panel.&lt;br /&gt;
: The flowchart window should resemble the one shown below (depending on the configuration.)&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Creating_a_Flowchart_Flowcode_Layout.png|500px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: The System Panel and Properties Panel can be moved by clicking and dragging the title bar at the top of each panel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prepare the input==&lt;br /&gt;
: More information about the icons used in this flowchart can be found in [[Icon Properties]].&lt;br /&gt;
* Drag and drop a [[Loop Icon Properties|Loop icon]] between the BEGIN and END icons.&lt;br /&gt;
: The 'Loop' icon will make the microcontroller repeatedly run through the program, (though the icon can be configured to limit the number of times this happens.)&lt;br /&gt;
&lt;br /&gt;
* Inside the loop, drag and drop an [[Input Icon Properties|Input icon]] from the [[Tools and Views#1) Icons Toolbar|Icons toolbar]].&lt;br /&gt;
:* This will be configured later and contain a variable value which will be used to read the state of the switch - to detect if the switch is being pressed..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Prepare the switch==&lt;br /&gt;
* Drag and drop a [[Decision Icon Properties|Decision icon]] after the 'Input' icon.&lt;br /&gt;
: This icon will be used to make the program perform what is known as a conditional branch when the following icons are configured.&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Creating_a_Flowchart_Icons_Layout.png|right]]&lt;br /&gt;
&lt;br /&gt;
: When the icons are configured and programmed, these icons will be able to continually check if the switch is being pressed or not.&lt;br /&gt;
: In the next step we will be adding icons which will allow us to control what happens if the switch is pressed. Note that the program will not function until the icons are configured and programmed.&lt;br /&gt;
&lt;br /&gt;
: Once programmed - when the switch is pressed it will perform an the action or process and continue to check if it is being pressed again.&lt;br /&gt;
: If the switch is not pressed it will follow the 'No' branch and keep looping to continue to check if the switch has been pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set up the lamp==&lt;br /&gt;
: Next we concentrate on the 'Yes' branch of the 'Decision' icon.&lt;br /&gt;
* Drag and drop an [[Output Icon Properties|Output icon]] in the 'Yes' branch.&lt;br /&gt;
: When programmed, this icon is going to function as a trigger to turn the lamp on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: Next we want the lamp to stay on for ten seconds and then turn off.&lt;br /&gt;
* Drag and drop a [[Delay Icon Properties|Delay icon]] after the 'Output' icon.&lt;br /&gt;
:* This is the icon which will allow us to delay the circuit for a specified period of time.&lt;br /&gt;
:* The delay will last for 10 seconds, in this time the circuit will not be able to carry out any other function until the delay is complete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:* Drag and drop a second 'Output' icon after the 'Delay' icon.&lt;br /&gt;
: Finally this will be used to turn the lamp off after the ten second delay.&lt;br /&gt;
&lt;br /&gt;
Your flowchart should now be set up to resemble the image to the right. Note that none of the icons are configured yet, so the program will not simulate or function, please see the next exercise to configure the icons so that the program will simulate accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should now [[Saving a Flowchart|save the flowchart]] as &amp;quot;Lamp1.fcf&amp;quot;, and [[Closing Flowcode|close Flowcode]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Creating a Flowchart.fcfx|Exercise - Creating a Flowchart}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What next?==&lt;br /&gt;
The flowchart is now ready to be configured and programmed in order to operate electronic devices (components). The configuration of the flowchart is covered in the exercise [[Exercise - Configuring Icons and Variables|Configuring Icons and Variables]].&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Documenting_a_Flowchart&amp;diff=14332</id>
		<title>Exercise - Documenting a Flowchart</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Documenting_a_Flowchart&amp;diff=14332"/>
		<updated>2014-01-16T15:59:06Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Adding Finishing Touches&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
This exercise assumes that you have created and tested the program described in exercise [[Exercise - Transferring a Program to the Microcontroller|Transferring a Program to the Microcontroller]].&lt;br /&gt;
&lt;br /&gt;
Documenting the flowchart is essential in some projects, although we have properly labelled the icons, a few comment icons helps to further explain the program and the process in further detail to aid expansion and helps others understand the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Load the Flowcode flowchart==&lt;br /&gt;
* [[Opening an Existing Flowchart|Open the flowchart]] called 'Lamp1.fcf' which you tested further in the exercise [[Exercise - Transferring a Program to the Microcontroller|Transferring a Program to the Microcontroller]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Benefits of documentation==&lt;br /&gt;
&lt;br /&gt;
Documenting your flowchart is very useful - it allows other users to understand your flowchart and allows them to learn and even add to your flowchart to help produce the final program and increase efficiency throughout the system.&lt;br /&gt;
&lt;br /&gt;
Adding comments to document your flowchart is extremely easy and very useful, using comments allows you to clarify the process, purpose and function of your program and allows others to understand it so they can see what is going on and learn from it and even help to develop the program, even by suggestion a more efficient method or directly editing a icon to function more effectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Adding comments==&lt;br /&gt;
[[File:Exercise_Documenting_a_Flowchart_Final_Flowchart.png|right]]&lt;br /&gt;
* Drag a [[Comment Icon Properties|Comment icon]] onto the flowchart above the 'Loop' icon.&lt;br /&gt;
* Double click the 'Comment' icon to open up the [[Comment Icon Properties]] dialogue box.&lt;br /&gt;
&lt;br /&gt;
:* Explain the purpose of the loop and how it is the base of the process.&lt;br /&gt;
&lt;br /&gt;
:: The loop is the base of the program as it allows the program to continually check if the switch has been pressed by repeating the process of detecting the state of the switch.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Add a comment above the 'Input' icon.&lt;br /&gt;
&lt;br /&gt;
* Open the icon properties by double clicking on the 'Comment' icon.&lt;br /&gt;
&lt;br /&gt;
:* Describe the use of the 'Input' icon and how it reads the state of the switch.&lt;br /&gt;
&lt;br /&gt;
:: The 'Input' icon uses a variable to read and store the state of the switch, this allows the information contained in the variable to be used to see if the switch is being pressed or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Comment and document the 'Decision' icon.&lt;br /&gt;
&lt;br /&gt;
:* Describe how the 'Decision' icon detects the state of the switch and decides the next step to take.&lt;br /&gt;
&lt;br /&gt;
:: The 'Decision' icon will read the information in the variable to see if the switch has been pressed, it then decides which process path to follow next, if it is not being pressed it will go straight through to the loop and continually check if the switch is being pressed or not. If the switch is being pressed the following icons activate the LED and turns it off after 10 seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Comment and document the 'Output' icon.&lt;br /&gt;
&lt;br /&gt;
:* Describe the function of the 'Output' icon.&lt;br /&gt;
&lt;br /&gt;
:: Once the 'Decision' icon detects that the switch is being pressed, the 'Output' icon turns on / lights up the LED and indicates that the switch has been pressed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Comment and document the 'Delay' icon.&lt;br /&gt;
&lt;br /&gt;
:* Describe the function and purpose of the icon.&lt;br /&gt;
&lt;br /&gt;
:: This delays the program and stops it from continuing with another process, this allows the LED to stay lit up due to the previous command, this delay lasts 10 seconds until the program is then continued.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Comment and document the second 'Output' icon.&lt;br /&gt;
&lt;br /&gt;
:* Explain the function of this icon and the process afterwards.&lt;br /&gt;
&lt;br /&gt;
:: After the 10 second delay, this icon will turn the LED off and then continue the process of the program, which in turn, will loop to check if the button is being pressed again, this is the completes the circuit and will continue to loop and repeat the process, until stopped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Save the Flowchart==&lt;br /&gt;
* Save the flowchart using the same name. The simplest way to do this is to click on the 'Save' icon. [[File:Btn Save.png|border]]&lt;br /&gt;
: For more information, see [[Saving a Flowchart]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Documenting a Flowchart.fcfx|Exercise - Documenting a Flowchart}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What next?==&lt;br /&gt;
Now that the flowchart is complete, and documented correctly, you can further expand and develop the flowchart in the next exercise [[Exercise - Expanding a Program|Expanding a Program]].&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Expanding_a_Program&amp;diff=14333</id>
		<title>Exercise - Expanding a Program</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Expanding_a_Program&amp;diff=14333"/>
		<updated>2014-01-16T15:59:06Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Taking Flowcode Further&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
This exercise assumes you have created, tested and documented the program described in the exercise [[Exercise - Documenting a Flowchart|Documenting a Flowchart]].&lt;br /&gt;
&lt;br /&gt;
Because you have documented the flowchart properly, you can easily and accurately change the program as you know exactly how the program functions and what process it goes through.&lt;br /&gt;
&lt;br /&gt;
You do not have to massively alter your program to make it more effective, sometimes a little change can make a big difference, simply adding and configuring one component can change the program to be much more effective and suitable for use elsewhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Load the Flowcode flowchart==&lt;br /&gt;
* [[Opening an Existing Flowchart|Open the flowchart]] called 'Lamp1.fcf' which you created earlier and documented in the exercise [[Exercise - Documenting a Flowchart|Documenting a Flowchart]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Enhancing a program==&lt;br /&gt;
Now that you have a fully functioning program which is properly documented both by display names of icons and detailed comments, you can manipulate this program integrate it into another system, or expand the program further and turn it into your own expanded system, and even turn it into a full application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are going to expand our program to function as a set of traffic lights, to do this we are going to add 2 more LEDs and add to our 'Decision' icon which responds to when the switch is on to activate the traffic lights accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the LEDs==&lt;br /&gt;
[[File:Exercise_Expanding_a_Program_Components.png|right]]&lt;br /&gt;
First of all, we are going to set up the System Panel and add two more LED components to expand the program.&lt;br /&gt;
* Add two LED components by using either of the following methods:&lt;br /&gt;
:* Either copy and paste the current component on the System Panel to duplicate the component.&lt;br /&gt;
:* Or add two more components by using the [[Tools and Views#2) Components Toolbar|Components Toolbar]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now position the LEDs accordingly on the System Panel.&lt;br /&gt;
* Move the LEDs to be aligned in a row on the Y axis.&lt;br /&gt;
* Ensure the original green LED component is at the bottom and that it is still connected to '$PORTB.0'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next change the colour and connection properties of the two new LEDs.&lt;br /&gt;
* Change the middle LED properties.&lt;br /&gt;
:* Connect the LED to Port B Pin 1 by changing the 'Connection' property to '$PORTB.1'.&lt;br /&gt;
:* Change the 'Color' property to yellow (00FFFF) using the colour selection window.&lt;br /&gt;
&lt;br /&gt;
* Change the top LED properties&lt;br /&gt;
:* Connect the LED to Port B Pin 2 by changing the 'Connection' property to '$PORTB.2'.&lt;br /&gt;
:* Change the 'Color' property to red (000FF) using the colour selection window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expand the program==&lt;br /&gt;
Now that the components are set up correctly, its time to configure the flowchart and expand the program.&lt;br /&gt;
Firstly we need to set up the default state of the traffic lights to display only the red light when the switch is not pressed.&lt;br /&gt;
[[File:Exercise_Expanding_a_Program_Final_Flowchart.png|right]]&lt;br /&gt;
* Add an 'Input' icon to the 'No' section of the 'Decision' icon.&lt;br /&gt;
:* Change the 'Display name:' to &amp;quot;Red on&amp;quot;.&lt;br /&gt;
:* Input the the value &amp;quot;1&amp;quot; into the 'Variable or value:' box.&lt;br /&gt;
:* Set the 'Port:' connection to 'PORTB'.&lt;br /&gt;
:* In the 'Output to:' section select 'Single Bit:' and change the pin to '2'.&lt;br /&gt;
:* Click 'OK' to confirm the changes to the icon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are now going to set up the activation sequence of the traffic lights by configuring and expanding the 'Yes' section of the 'Decision' icon.&lt;br /&gt;
&lt;br /&gt;
* Add 4 'Input' icons above the existing icons, then add a 'Delay' icon in-between the 4 'Input' icons.&lt;br /&gt;
:* We will configure these icons top to bottom as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Change the 'Display name:' of the first 'Input' icon to &amp;quot;Red on&amp;quot;.&lt;br /&gt;
:* This icon is the same as the previous one we set up in the 'No' section of the 'Decision icon'.&lt;br /&gt;
:* Send the value '1' to Port B, Pin 2.&lt;br /&gt;
&lt;br /&gt;
* For the second 'Input' icon change the name to &amp;quot;Yellow on&amp;quot;.&lt;br /&gt;
:* Similarly send the value '1' to Port B but this time send it to bit (pin) 1&lt;br /&gt;
&lt;br /&gt;
* Next is the 'Delay' icon.&lt;br /&gt;
:* Change the name to &amp;quot;For 1 second&amp;quot;.&lt;br /&gt;
:* Input the value &amp;quot;1&amp;quot; into the 'Delay value or variable:' box.&lt;br /&gt;
:* Change the unit to 'seconds'.&lt;br /&gt;
&lt;br /&gt;
* Switch the first two (red and yellow) lights off to allow the last (green) light to show on its own which we programmed before.&lt;br /&gt;
:* Alter the 'Input' icon after the 'Delay' icon.&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;Red off&amp;quot;.&lt;br /&gt;
::* Send the value &amp;quot;0&amp;quot; to Port B, Pin 1 - this switches off the red light.&lt;br /&gt;
:* Configure the next 'Input' icon, the last of the new icons we added.&lt;br /&gt;
::* Name it &amp;quot;Yellow off&amp;quot;.&lt;br /&gt;
::* Send the value &amp;quot;0&amp;quot; to Port B, Pin 2 - this switches off the yellow light.&lt;br /&gt;
&lt;br /&gt;
Next, the green light displays for 10 seconds before switching off, this is due to the icons we configured and programmed in the earlier exercises.&lt;br /&gt;
* Update the display names of the existing icons as follows:&lt;br /&gt;
:* Replace the &amp;quot;Switch on&amp;quot; display name with &amp;quot;Green on&amp;quot;.&lt;br /&gt;
:* Replace the &amp;quot;Switch off&amp;quot; display name with &amp;quot;Green off&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Under these icons add an 'Input' icon, followed by a 'Delay' icon and finally add the last 'Input' icon.&lt;br /&gt;
:* Configure the first 'Input' icon.&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;Yellow on&amp;quot;.&lt;br /&gt;
::* In the 'Variable or value:' box type &amp;quot;1&amp;quot;.&lt;br /&gt;
::* Change the 'Port:' to 'PORTB'.&lt;br /&gt;
::* In the 'Output to:' section select 'Single Bit:' and change the value to '1'.&lt;br /&gt;
&lt;br /&gt;
:* Now configure the 'Delay' icon.&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;For 2 seconds&amp;quot;.&lt;br /&gt;
::* Type &amp;quot;2&amp;quot; into the 'Delay value or variable:'.&lt;br /&gt;
::* Change the unit to 'seconds'&lt;br /&gt;
&lt;br /&gt;
:* Finally configure the last 'Input' icon.&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;Yellow off&amp;quot;.&lt;br /&gt;
::* In the 'Variable or value:' type &amp;quot;0&amp;quot;.&lt;br /&gt;
::* Change the 'Port:' to 'PORTB'&lt;br /&gt;
::* In the 'Output to:' section select 'Single Bit:' and change it to '1'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Final testing==&lt;br /&gt;
* [[Saving a Flowchart|Save the flowchart]].&lt;br /&gt;
* [[Starting Flowchart Simulation|Run the simulation]] to test that it works.&lt;br /&gt;
* If you are going to further expand a program, or release it for public use, be sure to [[Exercise - Documenting a Flowchart|document the flowchart]] accordingly to explain the process and describe what affect it has on the components.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Expanding a Program.fcfx|Exercise - Expanding a Program}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What next?==&lt;br /&gt;
Now you have effectively developed and expanded a program you can move on to other exercises and learn different areas, methods and techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are further exercises throughout the [[Flowcode Help Overview|Flowcode Help]] section, you can also go to the [[Exercises]] section for similar articles with instructions to follow to demonstrate processes such as creating a component.&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Configuring_Icons_and_Variables&amp;diff=14330</id>
		<title>Exercise - Configuring Icons and Variables</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Configuring_Icons_and_Variables&amp;diff=14330"/>
		<updated>2014-01-16T15:59:05Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Controlling Electronic Devices With Flowcode&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
This exercise assumes that you have already built the Flowcode flowchart described in the exercise [[Exercise - Creating a Flowchart|Creating a Flowchart]].&amp;lt;br /&amp;gt;&lt;br /&gt;
To set up and program the flowchart you must configure the icons and variables to create an effective and functioning process.&amp;lt;br /&amp;gt;&lt;br /&gt;
This will prepare the program to interact with components connected to the specific ports.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Load the Flowcode flowchart==&lt;br /&gt;
* Open the flowchart, called 'Lamp1.fcf' which you created in the exercise [[Exercise - Creating a Flowchart|Creating a Flowchart]].&lt;br /&gt;
:(For help with this, see the article [[Opening an Existing Flowchart]]) &lt;br /&gt;
: The System Panel and Panel Properties should be visible. If not, use the [[View]] menu to select them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Program the sequence==&lt;br /&gt;
&lt;br /&gt;
Now that the flowchart icons are correctly set up, we need to program them to carry out the following process:&lt;br /&gt;
:Check if the switch is pressed.&lt;br /&gt;
::If it isn't, go back to the beginning.&lt;br /&gt;
::If it is:&lt;br /&gt;
:::Switch on the lamp;&lt;br /&gt;
:::Wait for 10 seconds;&lt;br /&gt;
:::Switch off the lamp;&lt;br /&gt;
:::Go back to the beginning.&lt;br /&gt;
&lt;br /&gt;
It takes such a short time for the microcontroller to carry this out, that we don't need to worry whether the switch latches on or not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Program the input==&lt;br /&gt;
:* Double click on the [[Input Icon Properties|Input icon]]. &lt;br /&gt;
:: This opens the 'Properties: Input' dialogue box, allowing you to configure the way the program treats information from the switch.&lt;br /&gt;
:: This information will be contained in a variable called 'switch'.&lt;br /&gt;
&lt;br /&gt;
::* Click on the down arrow at the right-hand end of the 'Variable:' box to open the variables dialogue box.&lt;br /&gt;
::* Hover to the left of the 'Variables' label and click on the down arrow that appears.&lt;br /&gt;
::* Click on the 'Add new' option to open the 'Create a New Variable' dialogue box.&lt;br /&gt;
&lt;br /&gt;
::* [[Creating Variables|Create a new variable]] named &amp;quot;switch&amp;quot; with initial value &amp;quot;0&amp;quot; and description &amp;quot;Copies the state of the switch&amp;quot;&lt;br /&gt;
::* Leave the 'Variable type:' as 'Byte'.&lt;br /&gt;
::: (For more information about variables, see [[Creating Variables]] and [[Variable Types]].&lt;br /&gt;
::: (The resulting dialogue box is shown opposite.)&lt;br /&gt;
[[File:Exercise_Configuring_Icons_and_Variables_Input_Properties.png|250px|right]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:* Finish configuring the input properties as follows:&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;Read the switch&amp;quot;.&lt;br /&gt;
::* In the 'Variable:' box, type the name of the variable you created &amp;quot;switch&amp;quot;.&lt;br /&gt;
::* Leave the 'Port:' as PORT A.&lt;br /&gt;
::* Select to 'Input from:' 'Single Bit' and choose bit 0.&lt;br /&gt;
::: (The resulting dialogue box is shown opposite.)&lt;br /&gt;
&lt;br /&gt;
[[File:Exercise_Configuring_Icons_and_Variables_New_Variable.png|250px|right]]&lt;br /&gt;
&lt;br /&gt;
: Set up like this, the program monitors the state of the switch, which will be connected to bit 0 of Port A of the microcontroller.&lt;br /&gt;
: When the program looks at the input switch if it is pressed, the variable 'switch' contains logic 1. If unpressed, it contains logic 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Check the Switch==&lt;br /&gt;
:* Double click on the [[Decision Icon Properties|Decision icon]] to open the configuration dialogue box, and then: [[File:Exercise_Configuring_Icons_and_Variables_Decision_Properties.png|250px|right]]&lt;br /&gt;
::* Rename it &amp;quot;Switch pressed?&amp;quot;.&lt;br /&gt;
::* In the 'If:' box, type &amp;quot;switch=1&amp;quot;.&lt;br /&gt;
::* Leave the 'Swap Yes and No' box unchecked.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
&lt;br /&gt;
: This will cause the program to perform what is known as a conditional branch.&lt;br /&gt;
: The subsequent course of the program depends on the outcome of the condition specified in the 'Decision' icon.&lt;br /&gt;
: In this case, it depends on whether or not the variable 'switch' = 1.&lt;br /&gt;
: If it is, the program follows the 'Yes' route. If not, it follows the 'No' route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Control the Lamp==&lt;br /&gt;
: The 'No' branch is easy to set up. All we want is that the program returns to the beginning (taken care of by the 'Loop' icon.)&lt;br /&gt;
: No further configuration is needed.&lt;br /&gt;
[[File:Exercise_Configuring_Icons_and_Variables_Output_Properties_01.png|250px|right]]&lt;br /&gt;
&lt;br /&gt;
:* Double click the [[Output Icon Properties|Output icon]] to open the configuration dialogue box, and then:&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;Switch on&amp;quot;.&lt;br /&gt;
::* In the 'Variable or value:' box, type value &amp;quot;1&amp;quot;.&lt;br /&gt;
::* Change the 'Port:' to PORT B.&lt;br /&gt;
::* Select to 'Output to: 'Single Bit' and choose bit 0.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::: (The resulting dialogue box is shown opposite.)&lt;br /&gt;
&lt;br /&gt;
: The effect of this icon is to send a logic 1 signal (high voltage) to the lamp, connected to Port B, bit 0 of the microcontroller.&lt;br /&gt;
: This turns on the lamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: Now, we tackle the requirement that it stays on for ten seconds and then goes off.&lt;br /&gt;
[[File:Exercise_Configuring_Icons_and_Variables_Delay_Properties.png|250px|right]]&lt;br /&gt;
* Drag and drop a [[Delay Icon Properties|Delay icon]] after the 'Output' icon.&lt;br /&gt;
:* Double click on it to open the configuration dialogue box, and then:&lt;br /&gt;
::* Change the 'Display name:' to &amp;quot;For 10 seconds&amp;quot;.&lt;br /&gt;
::* Change the 'Delay value:' to '10'.&lt;br /&gt;
::* Change the unit to 'seconds'.&lt;br /&gt;
::* Click on 'OK'.&lt;br /&gt;
::: (The resulting dialogue box is shown opposite.)&lt;br /&gt;
[[File:Exercise_Configuring_Icons_and_Variables_Output_Properties_02.png|250px|right]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: Finally, we need to turn off the lamp, after the ten second delay.&lt;br /&gt;
* Double click on the second 'Output' icon to allow you to configure it.&lt;br /&gt;
:* Rename it &amp;quot;Switch off&amp;quot;, and configure it to deliver value &amp;quot;0&amp;quot; to single bit 0 of Port B.&lt;br /&gt;
:: (The resulting dialogue box is shown opposite.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should now [[Saving a Flowchart|save the flowchart]] as &amp;quot;Lamp1.fcf&amp;quot;, and [[Closing Flowcode|close Flowcode]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Configuring Icons and Variables.fcfx|Exercise - Configuring Icons and Variables}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What next?==&lt;br /&gt;
The next step is to add the switch and lamp to the flowchart. This is covered in the exercise [[Exercise - Adding Devices to a Program|Adding Devices to a Program]].&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Graphics&amp;diff=14321</id>
		<title>Event class Graphics</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Graphics&amp;diff=14321"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Graphics.Animated|Animated]]&lt;br /&gt;
|Notification than an animation has finished&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Graphics.Redraw|Redraw]]&lt;br /&gt;
|Reconstructs and redraws the target component&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Keyboard&amp;diff=14322</id>
		<title>Event class Keyboard</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Keyboard&amp;diff=14322"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Keyboard.ButtonName|ButtonName]]&lt;br /&gt;
|Sent to give a meaningful name to a button on a simulated mouse-click&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Keyboard.KeyMapDown|KeyMapDown]]&lt;br /&gt;
|Post when a mapped key is pressed for the component&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Keyboard.KeyMapUp|KeyMapUp]]&lt;br /&gt;
|Post when a mapped key is released for the component&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Keyboard.MappingKeys|MappingKeys]]&lt;br /&gt;
|Sent to find out how many keys it is possible to map to the component during simulation&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Keyboard.MappingName|MappingName]]&lt;br /&gt;
|Sent to give a meaningful name to a custom key-map event for a component&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Mouse&amp;diff=14323</id>
		<title>Event class Mouse</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Mouse&amp;diff=14323"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Mouse.Release|Release]]&lt;br /&gt;
|Post when the mouse is released on a child of the component during simulation&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Mouse.Click|Click]]&lt;br /&gt;
|Post when the mouse is clicked on a child of the component during simulation&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Mouse.Drag|Drag]]&lt;br /&gt;
|Post when the mouse is dragged on a child of the component during simulation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Scope&amp;diff=14324</id>
		<title>Event class Scope</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Scope&amp;diff=14324"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Scope.Decode|Decode]]&lt;br /&gt;
|Sent when a block of the stream is to be decoded into packets&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Scope.Overlay|Overlay]]&lt;br /&gt;
|Sent when the mouse hovers over a scope stream&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Simulation&amp;diff=14325</id>
		<title>Event class Simulation</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Simulation&amp;diff=14325"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Simulation.Pause|Pause]]&lt;br /&gt;
|Broadcast to all components that simulation has paused&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Simulation.Resume|Resume]]&lt;br /&gt;
|Broadcast to all components that simulation has resumed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Simulation.Start|Start]]&lt;br /&gt;
|Broadcast to all components that simulation is starting&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Simulation.Stop|Stop]]&lt;br /&gt;
|Broadcast to all components that simulation has stopped&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Sound&amp;diff=14326</id>
		<title>Event class Sound</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Sound&amp;diff=14326"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Sound.Complete|Complete]]&lt;br /&gt;
|Sent when a sound queued by the component has finished playing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_System&amp;diff=14327</id>
		<title>Event class System</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_System&amp;diff=14327"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event System.CleanHandle|CleanHandle]]&lt;br /&gt;
|Called when a custom handle is deleted to allow cleanup of resources&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event System.Timer|Timer]]&lt;br /&gt;
|Called back on the panel command System.TimerStart&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event System.User|User]]&lt;br /&gt;
|Called back on the panel command System.Notify&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Tooltip&amp;diff=14328</id>
		<title>Event class Tooltip</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Tooltip&amp;diff=14328"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Tooltip.GraphicPoll|GraphicPoll]]&lt;br /&gt;
|Called when a tooltip graphic is updating with the draw image already pushed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Tooltip.GetText|GetText]]&lt;br /&gt;
|Called when a tooltip text string can be displayed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Tooltip.GetGraphic|GetGraphic]]&lt;br /&gt;
|Called when a tooltip graphic can be displayed with the draw image already pushed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Adding_Devices_to_a_Program&amp;diff=14329</id>
		<title>Exercise - Adding Devices to a Program</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Exercise_-_Adding_Devices_to_a_Program&amp;diff=14329"/>
		<updated>2014-01-16T15:59:04Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Sidebar: Controlling Electronic Devices With Flowcode&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
This exercise assumes that you have already built the Flowcode flowchart described in the exercise [[Exercise - Configuring Icons and Variables|Configuring Icons and Variables]].&amp;lt;br /&amp;gt;&lt;br /&gt;
To complete the program, you need to add the two electronic components, the switch and the lamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Load the Flowcode Flowchart==&lt;br /&gt;
&lt;br /&gt;
* Open the flowchart, called 'Lamp1.fcf' which you created in the exercise [[Exercise - Configuring Icons and Variables|Configuring Icons and Variables]].&lt;br /&gt;
:(For help with this, see the article [[Opening an Existing Flowchart]]) &lt;br /&gt;
: The System Panel and Panel Properties should be visible. If not, use the [[View]] menu to select them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the Switch==&lt;br /&gt;
[[File:Exercise Adding Devices to a Program Switch Properties.png|300px|right]]&lt;br /&gt;
* Click on the 'Inputs' toolbox, and locate the [[Component: ID 5c1da48f ce54 4622 bdd9 fc812e373696|Push Round Panel]] [[File:Component Icon 5c1da48f ce54 4622 bdd9 fc812e373696.png]] switch.&lt;br /&gt;
* Hover over the image, and click on the down arrow that appears.&lt;br /&gt;
* Select the 'Add to system panel' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click on the switch on the [[System Panel]] to select it. Its properties appear in the Panel Properties.&lt;br /&gt;
: Notice that the name ('Handle') of the component selected appears at the top of the Panel Properties.&lt;br /&gt;
: In this case, it shows the name of the switch as 'sw_push_rnd_pnl'!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Find the 'Connections' properties on the Panel Properties, the box to the right of it.&lt;br /&gt;
: A pinout of the microcontroller appears. &lt;br /&gt;
:* Ensure that it is connected to Port A bit 0 by using the drop down menus or clicking on the rectangle representing the pin for Port A bit 0 (called RA0/AN0 on the graphic.)&lt;br /&gt;
:: This connects the switch to Port A bit 0 of the microcontroller, matching the settings you used when you created the flowchart.&lt;br /&gt;
:: This setting is shown opposite.&lt;br /&gt;
&lt;br /&gt;
:* No other properties need changing, though the [[Object Scale|Scale]] section allows you to change the size (and shape) of the switch if you wish.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Add the Lamp==&lt;br /&gt;
[[File:Exercise Adding Devices to a Program LED Properties.png|300px|right]]&lt;br /&gt;
* Click on the 'Outputs' toolbox, and locate and add an [[Component: ID a7b05886 784c 48c8 a6f6 cc371c7728e1|LED]] such as the [[Component: ID 7fdaec78 394e 4ec9 a578 4f1a12a12076|LED 5mm Panel]] component, which we will use as a lamp.&lt;br /&gt;
* Hover over the image, and click on the down arrow that appears.&lt;br /&gt;
* Select the 'Add to system panel' option.&lt;br /&gt;
* The LED appears in the middle of the System Panel, probably right on top of the switch.&lt;br /&gt;
: It should already be selected, but if not click on it.&lt;br /&gt;
: If so, drag it to a suitable position off to one side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* With the LED selected, look at the Panel Properties.&lt;br /&gt;
: Notice that the 'Handle' has changed to the name of the component handle.&lt;br /&gt;
: The 'Connection' property may not be connected to the correctly, as the flowchart expects it to be connected to Port B, bit 0.&lt;br /&gt;
:* Click on the box next to the 'Connection' property and, as before, a pinout of the chip appears.&lt;br /&gt;
:* Click on the rectangle representing the pin for bit 0 of Port B, shown as RB0/INT or use the drop down menus to connect the component.&lt;br /&gt;
:: The Panel Properties now show that the LED is connected to Port B, bit 0.&lt;br /&gt;
&lt;br /&gt;
:* Once again, no other properties need changing, though the 'Scale' section can alter the size of the component and the 'Color' property (also known as 'Bulb color' in other components) allows you to change the colour of the LED.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Save the Flowchart==&lt;br /&gt;
* Save the flowchart using the same name. The simplest way to do this is to click on the 'Save' icon. [[File:Btn Save.png|border]]&lt;br /&gt;
: For more information, see [[Saving a Flowchart]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download the exercise==&lt;br /&gt;
You can download the file created by this exercise and open it in Flowcode to identify errors in your program/file or you could also download the file to skip to the next exercise.&lt;br /&gt;
&lt;br /&gt;
*To download the file, click on the link below and then either:&lt;br /&gt;
:*Click on the file name.&lt;br /&gt;
:*Right click the file name and select 'Save link as...' or 'Save target as...' (depending on your browser).&lt;br /&gt;
&lt;br /&gt;
:::{{Fcfile|Exercise - Adding Devices to a Program.fcfx|Exercise - Adding Devices to a Program}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What next?==&lt;br /&gt;
Now that the flowchart is complete, we are ready to test it in simulation, as described in the next exercise [[Exercise - Simulating a Program|Simulating a Program]].&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_System.Timer&amp;diff=14311</id>
		<title>Event System.Timer</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_System.Timer&amp;diff=14311"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Called back on the panel command System.TimerStart&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class System|System]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|ULONG]] ''TimerID''&lt;br /&gt;
:The identifier passed to the System.TimerStart panel command&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_System.User&amp;diff=14312</id>
		<title>Event System.User</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_System.User&amp;diff=14312"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Called back on the panel command System.Notify&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class System|System]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|ULONG]] ''MessageID''&lt;br /&gt;
:The identifier passed to the System.Notify panel command&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|ULONG]] ''Data''&lt;br /&gt;
:Some data value to pass to the event&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Tooltip.GetGraphic&amp;diff=14313</id>
		<title>Event Tooltip.GetGraphic</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Tooltip.GetGraphic&amp;diff=14313"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Called when a tooltip graphic can be displayed with the draw image already pushed&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Tooltip|Tooltip]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Component''&lt;br /&gt;
:The object under the mouse&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''X''&lt;br /&gt;
:X size of tooltip area&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''Y''&lt;br /&gt;
:Y size of tooltip area&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
Non-zero to claim the tooltip event&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Tooltip.GetText&amp;diff=14314</id>
		<title>Event Tooltip.GetText</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Tooltip.GetText&amp;diff=14314"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Called when a tooltip text string can be displayed&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Tooltip|Tooltip]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Component''&lt;br /&gt;
:The object under the mouse&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|STRING]] ''Buffer''&lt;br /&gt;
:Text variable to update with the tool-tip&lt;br /&gt;
:''This parameter is returned back to Flowcode''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
Non-zero to claim the tooltip event&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Tooltip.GraphicPoll&amp;diff=14315</id>
		<title>Event Tooltip.GraphicPoll</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Tooltip.GraphicPoll&amp;diff=14315"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Called when a tooltip graphic is updating with the draw image already pushed&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Tooltip|Tooltip]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Component''&lt;br /&gt;
:The object under the mouse&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''X''&lt;br /&gt;
:X size of tooltip area&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''Y''&lt;br /&gt;
:Y size of tooltip area&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
Non-zero to keep the tooltip event&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Compile&amp;diff=14316</id>
		<title>Event class Compile</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Compile&amp;diff=14316"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
The Compile event class is called at various stages during compilation of the downloadable code, and allows a component to customise their C code as raw text. It covers everything from the size of a variables array to the contents of interrupt handlers.&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.Preprocess|Preprocess]]&lt;br /&gt;
|Broadcast to all components immediately before compilation is started&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddProperty|AddProperty]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global property declarations&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddConst|AddConst]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global variable declarations&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddVarSize|AddVarSize]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global array-size declarations&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddVar|AddVar]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global constant declarations&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddHeader|AddHeader]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of header code&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddInterrupts|AddInterrupts]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of the interrupts for a component&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.AddInterrupt|AddInterrupt]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of a single interrupts code&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.Start|Start]]&lt;br /&gt;
|Broadcast to all components that compilation is starting&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.Stop|Stop]]&lt;br /&gt;
|Broadcast to all components that compilation has stopped&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Compile.GetVarSize|GetVarSize]]&lt;br /&gt;
|Sent to a component to amend the size of the expected array&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
:''[[API Expand]]'' class&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Components&amp;diff=14317</id>
		<title>Event class Components</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Components&amp;diff=14317"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Property|Property]]&lt;br /&gt;
|Sent when a property has been changed by the User&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Added|Added]]&lt;br /&gt;
|Broadcast to all existing components once a new component has been added&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Adding|Adding]]&lt;br /&gt;
|Broadcast to all existing components when a new component is about to be added&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Resize|Resize]]&lt;br /&gt;
|Sent to the mouse target when the user has altered the position of a component child&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Removed|Removed]]&lt;br /&gt;
|Broadcast to all remaining components once an existing component has been removed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Removing|Removing]]&lt;br /&gt;
|Broadcast to all existing components when an existing component is about to be removed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Closedown|Closedown]]&lt;br /&gt;
|Closedown routine for the component&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Closing|Closing]]&lt;br /&gt;
|Pre-Closedown routine for the component, sent when the component is linked&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Initialise|Initialise]]&lt;br /&gt;
|Initialisation routine for the component once the component is linked to its parent&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Components.Initialising|Initialising]]&lt;br /&gt;
|Initialisation routine before the component is linked to its parent&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Connection&amp;diff=14318</id>
		<title>Event class Connection</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Connection&amp;diff=14318"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Connection.PinPopulate|PinPopulate]]&lt;br /&gt;
|Sent when auto-populate of digital connections is requested&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Connection.PinChange|PinChange]]&lt;br /&gt;
|Sent during simulation if a connected port pin changes&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Connection.AnPopulate|AnPopulate]]&lt;br /&gt;
|Sent when auto-populate of analog connections is requested&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Connection.AnChange|AnChange]]&lt;br /&gt;
|Sent during simulation if a connected ADC channel changes&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Connection.ChipChange|ChipChange]]&lt;br /&gt;
|Sent when the target device has changed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Connection.Unconnected|Unconnected]]&lt;br /&gt;
|Sent when the component is compiled with unconnected pins&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Console&amp;diff=14319</id>
		<title>Event class Console</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_Console&amp;diff=14319"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Console.AddLine|AddLine]]&lt;br /&gt;
|Post to the owning component when a line is inserted by the user&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Console.TextChanged|TextChanged]]&lt;br /&gt;
|Post when the console text is changed by the user in some way&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event Console.MemChanged|MemChanged]]&lt;br /&gt;
|Post when the console memory is changed by the user in some way&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_class_File&amp;diff=14320</id>
		<title>Event class File</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_class_File&amp;diff=14320"/>
		<updated>2014-01-16T15:59:03Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
See the individual events for details of how to use this event class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Events provided for this class==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event File.Changed|Changed]]&lt;br /&gt;
|Sent when a file being watched has changed&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;35%&amp;quot;|[[Event File.Closed|Closed]]&lt;br /&gt;
|Sent when a file monitor is being closed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Pause&amp;diff=14305</id>
		<title>Event Simulation.Pause</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Pause&amp;diff=14305"/>
		<updated>2014-01-16T15:59:02Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Broadcast to all components that simulation has paused&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Simulation|Simulation]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''This event has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
This event is sent to all components when simulation is paused at any time. At this point it may be assumed simulation is active but idle - none of the main flowchart program will be executed whilst paused.&lt;br /&gt;
&lt;br /&gt;
The system becomes active again on a [[Event Simulation.Resume|Simulation.Resume]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Resume&amp;diff=14306</id>
		<title>Event Simulation.Resume</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Resume&amp;diff=14306"/>
		<updated>2014-01-16T15:59:02Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Broadcast to all components that simulation has resumed&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Simulation|Simulation]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''This event has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Start&amp;diff=14307</id>
		<title>Event Simulation.Start</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Start&amp;diff=14307"/>
		<updated>2014-01-16T15:59:02Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Broadcast to all components that simulation is starting&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Simulation|Simulation]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''This event has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
Components usually become active when simulation starts, and become idle when simulation [[Event Simulation.Stop|stops]].&lt;br /&gt;
&lt;br /&gt;
This event is sent to all components to allow them to activate and prepare for simulation every time the user starts simulating.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Stop&amp;diff=14308</id>
		<title>Event Simulation.Stop</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Simulation.Stop&amp;diff=14308"/>
		<updated>2014-01-16T15:59:02Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Broadcast to all components that simulation has stopped&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Simulation|Simulation]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''This event has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Sound.Complete&amp;diff=14309</id>
		<title>Event Sound.Complete</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Sound.Complete&amp;diff=14309"/>
		<updated>2014-01-16T15:59:02Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Sent when a sound queued by the component has finished playing&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Sound|Sound]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''SoundH''&lt;br /&gt;
:The sound object that has played a sound&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_System.CleanHandle&amp;diff=14310</id>
		<title>Event System.CleanHandle</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_System.CleanHandle&amp;diff=14310"/>
		<updated>2014-01-16T15:59:02Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Called when a custom handle is deleted to allow cleanup of resources&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class System|System]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Handle''&lt;br /&gt;
:The object handle that is about to be freed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Mouse.Drag&amp;diff=14300</id>
		<title>Event Mouse.Drag</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Mouse.Drag&amp;diff=14300"/>
		<updated>2014-01-16T15:59:01Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Post when the mouse is dragged on a child of the component during simulation&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Mouse|Mouse]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Component''&lt;br /&gt;
:The component being dragged&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''X''&lt;br /&gt;
:X coordinate relative to 'Component'&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''Y''&lt;br /&gt;
:Y coordinate relative to 'Component'&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''Z''&lt;br /&gt;
:Z coordinate relative to 'Component'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Mouse.Release&amp;diff=14301</id>
		<title>Event Mouse.Release</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Mouse.Release&amp;diff=14301"/>
		<updated>2014-01-16T15:59:01Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Post when the mouse is released on a child of the component during simulation&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Mouse|Mouse]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''Component''&lt;br /&gt;
:The component clicked on&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''X''&lt;br /&gt;
:X coordinate relative to 'Component'&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''Y''&lt;br /&gt;
:Y coordinate relative to 'Component'&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|FLOAT]] ''Z''&lt;br /&gt;
:Z coordinate relative to 'Component'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
The return of this event is currently unused&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Reference&amp;diff=14302</id>
		<title>Event Reference</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Reference&amp;diff=14302"/>
		<updated>2014-01-16T15:59:01Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Flowcode provides an ''event interface'' to help writing simulation and PC-side programs.&lt;br /&gt;
&lt;br /&gt;
This event list allows Flowcode to communicate with the components through macros.&lt;br /&gt;
&lt;br /&gt;
An event may be thought of as a ''simulation-side interrupt''. Each event associated with a Flowcode program will call a macro when that event occurs.&lt;br /&gt;
&lt;br /&gt;
Events are grouped by ''class'' to provide context for their use. Below is a reference to the classes and events available:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Compile|Compile]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.Preprocess|Preprocess]]&lt;br /&gt;
|Broadcast to all components immediately before compilation is started&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddProperty|AddProperty]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global property declarations&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddConst|AddConst]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global variable declarations&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddVarSize|AddVarSize]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global array-size declarations&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddVar|AddVar]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of global constant declarations&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddHeader|AddHeader]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of header code&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddInterrupts|AddInterrupts]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of the interrupts for a component&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.AddInterrupt|AddInterrupt]]&lt;br /&gt;
|Sent to a component to allow dynamic amendment of a single interrupts code&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.Start|Start]]&lt;br /&gt;
|Broadcast to all components that compilation is starting&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.Stop|Stop]]&lt;br /&gt;
|Broadcast to all components that compilation has stopped&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Compile.GetVarSize|GetVarSize]]&lt;br /&gt;
|Sent to a component to amend the size of the expected array&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Components|Components]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Property|Property]]&lt;br /&gt;
|Sent when a property has been changed by the User&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Added|Added]]&lt;br /&gt;
|Broadcast to all existing components once a new component has been added&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Adding|Adding]]&lt;br /&gt;
|Broadcast to all existing components when a new component is about to be added&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Resize|Resize]]&lt;br /&gt;
|Sent to the mouse target when the user has altered the position of a component child&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Removed|Removed]]&lt;br /&gt;
|Broadcast to all remaining components once an existing component has been removed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Removing|Removing]]&lt;br /&gt;
|Broadcast to all existing components when an existing component is about to be removed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Closedown|Closedown]]&lt;br /&gt;
|Closedown routine for the component&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Closing|Closing]]&lt;br /&gt;
|Pre-Closedown routine for the component, sent when the component is linked&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Initialise|Initialise]]&lt;br /&gt;
|Initialisation routine for the component once the component is linked to its parent&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Components.Initialising|Initialising]]&lt;br /&gt;
|Initialisation routine before the component is linked to its parent&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Console|Console]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Console.AddLine|AddLine]]&lt;br /&gt;
|Post to the owning component when a line is inserted by the user&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Console.TextChanged|TextChanged]]&lt;br /&gt;
|Post when the console text is changed by the user in some way&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Console.MemChanged|MemChanged]]&lt;br /&gt;
|Post when the console memory is changed by the user in some way&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Connection|Connection]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Connection.PinPopulate|PinPopulate]]&lt;br /&gt;
|Sent when auto-populate of digital connections is requested&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Connection.PinChange|PinChange]]&lt;br /&gt;
|Sent during simulation if a connected port pin changes&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Connection.AnPopulate|AnPopulate]]&lt;br /&gt;
|Sent when auto-populate of analog connections is requested&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Connection.AnChange|AnChange]]&lt;br /&gt;
|Sent during simulation if a connected ADC channel changes&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Connection.ChipChange|ChipChange]]&lt;br /&gt;
|Sent when the target device has changed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Connection.Unconnected|Unconnected]]&lt;br /&gt;
|Sent when the component is compiled with unconnected pins&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Scope|Scope]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Scope.Decode|Decode]]&lt;br /&gt;
|Sent when a block of the stream is to be decoded into packets&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Scope.Overlay|Overlay]]&lt;br /&gt;
|Sent when the mouse hovers over a scope stream&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Simulation|Simulation]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Simulation.Pause|Pause]]&lt;br /&gt;
|Broadcast to all components that simulation has paused&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Simulation.Resume|Resume]]&lt;br /&gt;
|Broadcast to all components that simulation has resumed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Simulation.Start|Start]]&lt;br /&gt;
|Broadcast to all components that simulation is starting&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Simulation.Stop|Stop]]&lt;br /&gt;
|Broadcast to all components that simulation has stopped&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class System|System]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event System.CleanHandle|CleanHandle]]&lt;br /&gt;
|Called when a custom handle is deleted to allow cleanup of resources&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event System.Timer|Timer]]&lt;br /&gt;
|Called back on the panel command System.TimerStart&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event System.User|User]]&lt;br /&gt;
|Called back on the panel command System.Notify&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Sound|Sound]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Sound.Complete|Complete]]&lt;br /&gt;
|Sent when a sound queued by the component has finished playing&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Tooltip|Tooltip]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Tooltip.GraphicPoll|GraphicPoll]]&lt;br /&gt;
|Called when a tooltip graphic is updating with the draw image already pushed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Tooltip.GetText|GetText]]&lt;br /&gt;
|Called when a tooltip text string can be displayed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Tooltip.GetGraphic|GetGraphic]]&lt;br /&gt;
|Called when a tooltip graphic can be displayed with the draw image already pushed&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class File|File]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event File.Changed|Changed]]&lt;br /&gt;
|Sent when a file being watched has changed&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event File.Closed|Closed]]&lt;br /&gt;
|Sent when a file monitor is being closed&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Graphics|Graphics]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Graphics.Animated|Animated]]&lt;br /&gt;
|Notification than an animation has finished&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Graphics.Redraw|Redraw]]&lt;br /&gt;
|Reconstructs and redraws the target component&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Keyboard|Keyboard]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Keyboard.ButtonName|ButtonName]]&lt;br /&gt;
|Sent to give a meaningful name to a button on a simulated mouse-click&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Keyboard.KeyMapDown|KeyMapDown]]&lt;br /&gt;
|Post when a mapped key is pressed for the component&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Keyboard.KeyMapUp|KeyMapUp]]&lt;br /&gt;
|Post when a mapped key is released for the component&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Keyboard.MappingKeys|MappingKeys]]&lt;br /&gt;
|Sent to find out how many keys it is possible to map to the component during simulation&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Keyboard.MappingName|MappingName]]&lt;br /&gt;
|Sent to give a meaningful name to a custom key-map event for a component&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | [[Event class Mouse|Mouse]]&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Mouse.Release|Release]]&lt;br /&gt;
|Post when the mouse is released on a child of the component during simulation&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Mouse.Click|Click]]&lt;br /&gt;
|Post when the mouse is clicked on a child of the component during simulation&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;30%&amp;quot; | [[Event Mouse.Drag|Drag]]&lt;br /&gt;
|Post when the mouse is dragged on a child of the component during simulation&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Event_Scope.Decode&amp;diff=14303</id>
		<title>Event Scope.Decode</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Event_Scope.Decode&amp;diff=14303"/>
		<updated>2014-01-16T15:59:01Z</updated>

		<summary type="html">&lt;p&gt;JonnyW: XML import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;sidebar&amp;gt;Event Contents&amp;lt;/sidebar&amp;gt;&lt;br /&gt;
Sent when a block of the stream is to be decoded into packets&lt;br /&gt;
&lt;br /&gt;
This event is part of the [[Event class Scope|Scope]] class&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
[[Variable Types|HANDLE]] ''StreamH''&lt;br /&gt;
:The stream handle&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|ULONG]] ''TimeUS''&lt;br /&gt;
:The -ve offset from now of the earliest time to be decoded, in microseconds&lt;br /&gt;
&lt;br /&gt;
[[Variable Types|ULONG]] ''OverlaySize''&lt;br /&gt;
:The number of microseconds of the decoded packet from its start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Return value==&lt;br /&gt;
[[Variable Types|ULONG]]&lt;br /&gt;
Non-zero if the data could be decoded&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detailed description==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional information&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;/div&gt;</summary>
		<author><name>JonnyW</name></author>
		
	</entry>
</feed>