Recent Changes - Search:
<^< 7-Segment Displays | Course index | Using the Quad Display >^>

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 * The LCD Display * Binary Numbers * Decisions * Goto (Connection Point) * 7-Segment Displays ## Set up the Equipment ## 7-Segment Displays ##

Using a Single digit ## Using the Quad Display ## Getting the Timing Right * 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

Using a Single Digit

<^< 7-Segment Displays | Course Index | Using the Quad Display >^>(:nl:)

Before you can use the 7-segment display you need to add one to your project.

Select the 'Outputs' button and click on the '7 Segment Single' component in the toolbar to add one to your program. A 7-segment display will now appear on the panel.

The selected component's name in top box of the 'Properties Pane' allows you to know which particular component you are using. By default the 7-segment display is connected to all 8 pins on Port B, and 'common' pin is connected to '$PORTA.0' (A0). You can change this, but we will keep the default connections for now.

Unlike the LCD display, the 7-segment is ready to use straight away, so lets dive in and display our first number.

Drag a 'Component Macro' icon onto the flowchart and open up the macro dialogue box.

Look down the list of available macros for and select the 'SetDigit' macro in the 'led_7seg_single' section.

The 'SetDigit' macro takes two parameters - 'DecimalPoint' and 'Digit'. Digit is the number we wish to display, lets set this to display the number 6. DecimalPoint determines whether to show the decimal point or not. Set this to 0 to disable the decimal point or set it to 1 to display/enable the decimal point (just like switching an LED on or off) set this to 0 to hide the decimal point.

When you run the program the number 6 should appear on the 7-segment display and the decimal point should not be displayed.

(: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 14, 2013, at 03:31 PM