Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices

E-Blocks

Flowcode Step By Step

PICmicro Projects

Labs

Jumping Out of a Loop

<^< Set up the Equipment | Course Index | 7-Segment Displays >^>

During the section on the LCD display you developed the following program:

You should now change this as follows:

  1. Add a target 'Connection Point' (the top one) to the beginning of the program.
  2. Add a calculation icon below the 'Connection Point'. In the Calculation icon type "Count = 0". This will reset the value of 'Count' to '0'.
  3. Add a 'Push Round Panel' to the System Panel. Connect it to Port A bit 0.
  4. Just before the last icon (inside the Loop) add an Input icon, and a Decision icon and a 'Jump(Goto) Connection Point' icon (the bottom of the two) into the 'Yes' branch of the Decision icon.
  5. Set the properties of the Input icon to get the status of pin A0 and place it into a new (Byte) variable called "RESET".
  6. In the decision box test the value of the reset switch by typing "RESET = 1" into the 'If:' text box. your program should now look like this:

If you run the program you should find that the display counts up in hundredths of a second until the reset switch is pressed. When the reset switch is pressed the program jumps out of the loop back to the beginning of the program to reset the value of 'Count' variable.

<^< Set up the Equipment | Course index | 7-Segment Displays >^>

Print - Search - Login

Page last modified on May 13, 2013, at 11:15 AM