Difference between revisions of "Exercise - System Panel - Adding Objects"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
This exercise starts the process of building the display panel for a car. It sets up the System Panel, loaded with a warning LED, mounted on the instrument panel. Although specific settings are given, you should play around with alternatives to see the effect.
+
This exercise starts the process of building the display panel for a car. It sets up the System Panel, with a warning LED. Although specific settings are given, you should play around with alternatives to see the effect.
  
  
 +
==New flowchart==
 
* Open a new Flowcode flowchart, using the default microcontroller.
 
* Open a new Flowcode flowchart, using the default microcontroller.
  
Line 7: Line 8:
  
  
 +
==General options==
 
* Click on the 'General options' tab [[File:Panel Icon GeneralOpts.jpg|30px]]
 
* Click on the 'General options' tab [[File:Panel Icon GeneralOpts.jpg|30px]]
 
: Make the following changes:
 
: Make the following changes:
Line 16: Line 18:
  
  
[[File:gen_exerciseSystemPaneladdobjects_inputtoolbox_01.png|150px|right]]
+
 
 +
==Grid and snap options==
 
* Click on the 'Grid and Snap options' tab [[File:Panel Icon Tools.jpg|30px]]
 
* Click on the 'Grid and Snap options' tab [[File:Panel Icon Tools.jpg|30px]]
 
: Make the following changes:
 
: Make the following changes:
Line 23: Line 26:
  
  
 +
==Add the LED==
 +
[[File:gen_exerciseSystemPaneladdobjects_inputtoolbox_01.png|150px|right]]
 
* Click on the 'Outputs' toolbox and locate the 'Single LED'.
 
* Click on the 'Outputs' toolbox and locate the 'Single LED'.
  
Line 32: Line 37:
 
[[File:gen_exerciseSystemPaneladdobjects_systempanel1_01.png|150px|center]]
 
[[File:gen_exerciseSystemPaneladdobjects_systempanel1_01.png|150px|center]]
  
 +
==Change the LED properties==
 
* Click on the LED to select it.  
 
* Click on the LED to select it.  
 
: In the Panel Properties, two properties appear for the LED - 'color' and 'pin'.
 
: In the Panel Properties, two properties appear for the LED - 'color' and 'pin'.
Line 51: Line 57:
 
* In similar fashion, change the 'Height' ('He...') to 10mm and the 'Depth' ('De...') to 5mm.
 
* In similar fashion, change the 'Height' ('He...') to 10mm and the 'Depth' ('De...') to 5mm.
  
 +
 +
==Zoom in==
 
* As a result, the LED now looks very small on the System Panel.
 
* As a result, the LED now looks very small on the System Panel.
 
: You can zoom in to make it look larger. To do this:
 
: You can zoom in to make it look larger. To do this:
: Hold down the control 'Ctrl' key on the keyboard.
+
: Hold down the control 'Ctrl' key on the keyboard. The 'zoom' icon appears. [[File:Panel Icon Zoom.jpg|30px]]
 +
: 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.
 +
: Adjust the zoom so that the 'Table top' fills most of the System Panel, making the LED more visible.
 +
 
 +
==Switch on==
 +
* Click and drag an 'Output' icon to your flowchart.
 +
: Double-click on it and change the 'Variable or value' setting from '0' to '255'.
 +
: Run the simulation, by clicking on the 'Run' icon

Revision as of 10:29, 29 May 2013

This exercise starts the process of building the display panel for a car. It sets up the System Panel, with a warning LED. Although specific settings are given, you should play around with alternatives to see the effect.


New flowchart

  • Open a new Flowcode flowchart, using the default microcontroller.
  • Make sure that the System Panel is visible. If necessary, click on View and then on the check-box next to 'System Panel'.


General options

  • Click on the 'General options' tab 30px
Make the following changes:
  • Move the 'Level of detail' slider fully to the right (to '10').
  • Select 'Table top' shadow mode.
  • 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.)
  • Set the 'Table top' size to '20'.
  • 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.)


Grid and snap options

  • Click on the 'Grid and Snap options' tab 30px
Make the following changes:
  • Set it to snap to the 'Table top', by clicking on the check-box next to the 'Table top' label.
  • Leave the 'Show' gridlines box unchecked.


Add the LED

  • Click on the 'Outputs' toolbox and locate the 'Single LED'.
  • Click on the down-arrow next to it and then on 'Add to system panel'.


  • Right click anywhere on the System Panel and select the 'Zoom to 100%' option.
The System Panel should now resemble the one shown below.

Change the LED properties

  • Click on the LED to select it.
In the Panel Properties, two properties appear for the LED - 'color' and 'pin'.
  • The 'color' property is set as red (0x0000FF). Click on this value, and change it to orange (0x0080FF).
You may see very little change in the appearance of the LED, as currently it is turned off.
  • The 'pin' property determines which pin of the microcontroller the LED is connected to.
Currently, this is $PORTA,0 (pin 0 of PORTA). Click on the label. A pinout of the microcontroller appears.
Click on bit 1 (RA1/AN1) to change this connection.
  • The Panel Properties also gives information about the size and position of the LED.
By default, size is shown in terms of 'Scale'.
Hover the cursor over the folder icon next to the 'Scale' label, and then click on the down-arrow that appears.
Select 'World size'.
  • Click on the 'Width' setting, (which may be shortened to 'Wi...'). Change it to 10mm.
  • In similar fashion, change the 'Height' ('He...') to 10mm and the 'Depth' ('De...') to 5mm.


Zoom in

  • As a result, the LED now looks very small on the System Panel.
You can zoom in to make it look larger. To do this:
Hold down the control 'Ctrl' key on the keyboard. The 'zoom' icon appears. 30px
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.
Adjust the zoom so that the 'Table top' fills most of the System Panel, making the LED more visible.

Switch on

  • Click and drag an 'Output' icon to your flowchart.
Double-click on it and change the 'Variable or value' setting from '0' to '255'.
Run the simulation, by clicking on the 'Run' icon