Difference between revisions of "Exercise - Adding Devices to a Program"

From Flowcode Help
Jump to navigationJump to search
Line 7: Line 7:
  
 
==Load the Flowcode Flowchart==
 
==Load the Flowcode Flowchart==
The flowchart sequence will be:
+
* Open the flowchart, called 'Lamp1.fcf' which you created in the exercise [[Exercise - Creating Your First Flowchart|Creating Your First Flowchart]].
: Check if the switch is pressed.
+
:(For help with this, see
:: If it isn't, go back to the beginning.
+
: The System Panel and Panel Properties should be visible. If not, use the [[View]] menu to select them.
:: If it is:
+
* Click on the 'Inputs' toolbox, and locate the 'Push Round Panel' switch.
::: switch on the lamp;
+
* Hover over the image, and click on the down arrow that appears.
::: wait for 10 seconds;
+
* Select the 'Add to system panel' option.
::: switch off the lamp;
+
* Click on the switch on the [[System Panel]] to select it. Its properties appear in the Panel Properties.
::: go back to the beginning.
+
* Find the 'Connections' properties on the Panel Properties, and click on the 'Unconnected' label.
 +
: A pinout of the microcontroller appears.
 +
:* Click on the rectangle representing the pin for Port A bit 0 (called RA0/AN0 on the graphic.
 +
:: This connects the switch to Port A bit 0 of the microcontroller, matching what you did when you set up the 'Input' icon in the flowchart.

Revision as of 16:33, 12 June 2013

This exercise assumes that you have already built the Flowcode flowchart described in the exercise Creating Your First Flowchart.
To complete the program, you need to add the two electronic components, the switch and the lamp.



Load the Flowcode Flowchart

(For help with this, see
The System Panel and Panel Properties should be visible. If not, use the View menu to select them.
  • Click on the 'Inputs' toolbox, and locate the 'Push Round Panel' switch.
  • Hover over the image, and click on the down arrow that appears.
  • Select the 'Add to system panel' option.
  • Click on the switch on the System Panel to select it. Its properties appear in the Panel Properties.
  • Find the 'Connections' properties on the Panel Properties, and click on the 'Unconnected' label.
A pinout of the microcontroller appears.
  • Click on the rectangle representing the pin for Port A bit 0 (called RA0/AN0 on the graphic.
This connects the switch to Port A bit 0 of the microcontroller, matching what you did when you set up the 'Input' icon in the flowchart.