| 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
- ta1dr
- andyo
- Jon Chandler
Forum Activity
the LCD demo hello world - jon chandler Tuesday, 09 March 2010 23:48 - [28 replies]
USB problem - jon chandler Tuesday, 09 March 2010 11:31 - [3 replies]
Servo Module - andyo Tuesday, 09 March 2010 03:39 - [3 replies]
pic to ps2 communication - roshan Friday, 05 March 2010 01:30 - [7 replies]
Way Off Topic: Worldwide Ignite Week - jon chandler Wednesday, 03 March 2010 20:33 - [4 replies]
PIC USB with C and Visual C++ Project - hop Tuesday, 02 March 2010 21:49 - [0 replies]
Function generator help - magic Tuesday, 02 March 2010 16:37 - [10 replies]





link:http://www.b2c2u.com/ [air jordan] [url=http://www.handba...
I was thinking of battery with powered routers or powered for every...
50 rooms - wow. The XBee modules are very easy to use but I'm not ...
Thanks AndyO. What I have to do is design a device to monitor temp...
The circuit used for the remote sensor can be found here: [url]http...
plz i need help do u know from where i could download it or how cou...
hello everyone i'm trying to finish my final project and i want to ...
Thanks that was helpful