Recent Changes - Search:

Introduction to Microcontroller Programming

About PICmicro Chips

Clocking Your PICmicro Devices

E-Blocks

Flowcode Step By Step

PICmicro Projects

Labs

Using a Single Digit

<^< 7-Segment Displays | Course Index | Using the Quad Display >^>

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.

<^< 7-Segment Displays | Course index | Using the Quad Display >^>

Print - Search - Login

Page last modified on May 14, 2013, at 03:31 PM