Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices

E-Blocks

Flowcode Step By Step

PICmicro Projects

Labs

Variables

<^< Set up the Flowchart | Course Index | Using Variables >^>

  1. Right-click on the Input icon, and select 'Properties' from the menu. The following dialogue box appears.
  1. This is the Input Properties dialogue box. Next we are going to add a 'Variable'.
  2. But what is a variable? A variable is a place where we can store information - in particular, information that changes as our program runs: in this case, the number of the heat sensor that triggers the alarm. It might be sensor 1 that goes off, or sensor 5. We are going to use a variable called "SENSOR" (without quotation marks) to store which sensor has been triggered.
  3. Click on the button next to the 'Variable:' box. You will see the next dialogue box:
  1. Now hover over the word 'Variables' and button will appear. Click it then select 'Add new'. You now see another dialogue box shown below. You have a large choice of variables here but for now leave the default setting of 'Byte'. This allows you to have a variable that can vary between 0 and 255. More about this on the next screen.
  1. You are now asked for the name of the new variable. Type the name "SENSOR" (without quotation marks) and click on the OK button. This name now appears in the list of variables that your flowchart can use.
  2. Double-click on the name of the variable to use it, or alternatively click and drag the name into the variable box.
  3. You now see the Input Properties box again. Notice that you need to tell the system which port you are going to use to input the data the system needs. It is set to Port A at the moment, and we are going to leave it that way. In this case, the system needs to know what the heat sensors are doing, so each heat sensor will be connected to a different bit of Port A. Click on OK to close the Input Properties box.

<^< Set up the Flowchart | Course index | Using Variables >^>

Print - Search - Login

Page last modified on May 13, 2013, at 03:48 PM