Recent Changes - Search:
<^< Set up the Outputs | Course index | Basic Loops >^>

Introduction to Microcontroller Programming * Course Index * Introduction * About the Author * About this Course * Feedback * Course Navigation * Quick Course Navigation * How to use this Course * Acronyms Used and Course Conventions

About PICmicro Chips * What is a PICmicro? * Microcontrollers * Digital versus Analogue * Inputs and Outputs * Memory * Programming * 16F1937 Architecture

Clocking Your PICmicro Devices * Introduction * The Clock Circuit * Clock Settings * Clock Confusion

E-Blocks * Introduction to E-blocks * Using E-blocks * E-blocks Boards

Flowcode Step By Step * Introduction to Flowcode * Basic Flowcode Functions * Digital Outputs * Digital Inputs ## Set up the Equipment ## Equivalent Circuit ## Where's the Fire? ## Set up the Flowchart ## Variables ## Using Variables ## Set up the Outputs ##

Adding the Switches * Basic Loops * The LCD Display * Binary Numbers * Decisions * Goto (Connection Point) * 7-Segment Displays * Software Macro * Strings and Memory * A Simple Hi-Fi

PICmicro Projects * Introduction to PICmicro Projects * Construction Methods * Choosing a Power Source * Adding Inputs * Input Conditioning * Adding Outputs * Adding Drivers

Labs * Introduction and Lesson Plan * 1. Output * 2. Delay * 3. Connection Point * 4. Calculations * 5. Loop * 6. Input * 7. Decision * 8. LCD * 9. Keypad * 10. Analogue + EEPROM * 11. Software Macro * 12. External Interrupt * 13. Timer Interrupt

(:Summary:Contains the 'action' links (like Browse, Edit, History, etc.), placed at the top of the page, see site page actions:) (:comment This page can be somewhat complex to figure out the first time you see it. Its contents are documented at PmWiki.SitePageActions if you need help. :) * Print (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) * %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) * Login

Adding the Switches

<^< Set up the Outputs | Course Index | Basic Loops >^>(:nl:)

You are going to use switches to represent the heat sensors. A switch that is switched on is used to mimic a heat sensor that has triggered the fire alarm. You will use five switches to represent the five heat sensors.

# Click on the Inputs button and select the Switch Array Drag the switches into a suitable spot on the System Panel.

# Click once on the box next to the 'Count' property to change the value of the property, change the value to '5'. Ensure the component is connected to 'PORTA'

# Click once on the 'Step Into' button.

# The 'Simulation Debugger' window then appears, you can ignore this for now.

# Move the cursor over one of the switches and click. You will see the switch graphic toggle to a closed switch. This simulates causing a fire. click the Step Into button a couple more times to complete the program. You have just caused a fire, which has turned on that heat sensor. Notice that the LED array tells you, or the fire brigade, which sensor detected the fire.

The program is finished, and working. (:nl:)(:table style="clear:both":)

(:Summary: Website page footer:)

Print - (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) Search - Login

Page last modified on July 19, 2013, at 01:43 PM