This time, set the Panel Properties to display sizes as 'Scale'.
To do this, click on the down arrow next to 'World size' and select the 'Local scale'option.
Set up the Dashboard Panel
Make sure that the Dashboard Panel is visible. If it is not, then click on the View menu and tick the check box next to 'Dashboard Panel'.
Select a suitable color for the background, such as dark green (red=0, green=128, blue=0) by clicking on the 'General options' tab.File:Panel Icon GeneralOpts.jpg
Add the switch
Click on the 'Inputs' toolbox and locate the 'Toggle Metal Panel' switch.
Click on the down arrow next to it and then on the 'Add to dashboard panel' option.
The switch appears at the center of the Dashboard Panel.
Click on it to select it. Its properties are shown in the Panel Properties.
Click on the 'pin' property. A pinout of the microcontroller appears.
Click on pin 'RB0/Int' to connect the switch to bit 0 of PORT B.
Add a label to identify it (as there will be others!)
To do this:
Click on the colored rectangle at the top of the vertical toolbar on the right-hand side of the Dashboard Panel.
Click on the text icon, (the letter 'T') and drag it onto the Dashboard Panel.
It may not be visible at this stage, but the Panel Properties will show it as the object called 'label', and list four properties - 'Color' 'Background', 'Font' and 'Text'.
The default text content is 'Please Change Caption". Click on this and overwrite it with the word "sidelight
In addition change :
the background color to yellow (0x00FFFF);
the coordinates to 'X'=0, 'Y'=-10, 'Z'=0;
the scale to 'Width'=5, 'Height'=5, 'Depth'=2.
The Dashboard Panel now resembles that shown opposite:
The Flowcode flowchart
Add an infinite loop to the flowchart, and inside it:
Drag and drop an 'Input' icon.
Double-click on it to configure it.
Rename it "Check the switch". ::: Click the down arrow at the end of the 'Variable:' box.
Next click on the down arrow in front of the label 'Variables', and select the 'Add new' option.
The 'Create a New Variable' dialogue box opens. Enter the name "switch" for the new variable.
Leave the 'Initial value' and 'Description' boxes empty, but select 'Bool' (Boolean) as the variable type.