| Swordfish Tutorial - 7 Segment Display (Single) |
|
|
| Saturday, 04 April 2009 07:36 | |
|
This is a very limited example of segment displays. For full functionality and extended library support, please go to the multiple segment display tutorial.
7 segment displays are a cheap and effective way to display data. The only real downsides to them are;
The data that they display can be manipulated so that the same 7 data lines can multiplex information onto other displays at the same time. This can be seen in the Multiple section. But for now, and future routines, this diagram illustrates how to connect a common cathode 7 segment display to a PIC micro.
The box that the 7 segment is in represents the common. There are two types of 7 segment displays, common cathode and common anode. In my projects, I use common cathode displays. i.e.
Device = 18F452 // declare what pic is in use Clock = 20 // clock speed Dim Variable1 as Byte // declare a variable to use later #option Segment_Port = PORTB // define what port the segment is on Include "Single7Seg.bas" // include the segment display library Include "utils.bas" // include the utils library for "digit" // function Variable1 = 0 // initialize settings While True // create an infinite loop Update(Digit(Variable1,1)) // display the 1st digit of the variable DelaymS(1000) // wait of 1 second Inc(Variable1) // increment the variable Wend
The "Update" procedure will decode a single digit from 0-9 and display the relevant data on the segment display, easy. |
|
| Last Updated ( Friday, 24 April 2009 10:47 ) |
Whos Online
- Graham
- andyo
- Jon Chandler
Forum Activity
Marching LEDs - mrdeb Saturday, 13 March 2010 22:54 - [7 replies]
Credit Where Credit's Due - jon chandler Saturday, 13 March 2010 18:51 - [4 replies]
USB 8 Channel Servo Controller - andyo Saturday, 13 March 2010 01:19 - [2 replies]
Dedicated Servo Controller - graham Friday, 12 March 2010 17:58 - [0 replies]
Must have....delta temperature glowies! - graham Friday, 12 March 2010 17:31 - [3 replies]
A 'throw-away" PIC board - jon chandler Friday, 12 March 2010 13:41 - [31 replies]
iHID - graham Friday, 12 March 2010 02:04 - [5 replies]





Very nice - 900,000 packets and 0 errors - can't ask for better tha...
proton
Here is a spreadsheet of compatible parts: [url]http://digital-diy...
What program do you use to capture the simulation to a videofile?
Here's a tip for tying out SD cards. An SD card will fit the flopp...
If this wasn't a class project that had to be done on a PIC16F690 u...
I am going to send two data from ADC to USART(async mode) to serial...
I was thinking of battery with powered routers or powered for every...