Recent Changes - Search:
<^< Create the Variables | Course index | Loop Properties >^>

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 * Basic Loops ## Set up the Equipment ## Counting Sheep Badly ## Set up the Flowchart ## Create the Variables ##

Set up the Calculation ## Loop Properties ## Set up the Input ## Set up the Output ## Adding the LED array ## Adding the Switches ## Simulation ## The Solution - Adding a Delay * 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

Set up the Calculation

<^< Create the Variables | Course Index | Loop Properties >^>(:nl:)

# Double-click on the Calculation icon to open the Properties dialogue box.

# Change the Display name to "New total".

# Tell the Calculation icon what it is supposed to calculate by typing the following equation in the Calculations window:

->TOTAL = TOTAL + SHEEP

->We are going to simulate the light beam using a single push switch on Port A bit 0 - the switch marked 'SW0' on the switch board.

** The Input Properties are set up to store whatever number appears on port A in the variable called 'SHEEP'. ** When the switch is not pressed, the number on Port A is 0, and this is stored in the variable 'SHEEP'. ** When we press the switch, the number 1 is inputted via Port A, and stored in the variable 'SHEEP'.

->(As we are using only one switch, the biggest number we can produce on Port A is 1.)

->When the Calculation icon is activated, the number stored in the variable 'SHEEP' is added to the 'TOTAL' variable. When a sheep breaks the light beam, in other words, then 'TOTAL' is increased by 1. When no sheep is present, 'TOTAL' remains unchanged.

# Then click on the OK button, to close the dialogue box. (: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 May 03, 2013, at 04:04 PM