SEARCH
TOOLBOX
LANGUAGES
modified on 17 September 2014 at 17:54 ••• 29,978 views

03-05 SevenSegDisplay

From Manuals

(Difference between revisions)
Jump to: navigation, search
Line 12: Line 12:
|-
|-
|D0
|D0
-
|P_
+
|P6_5
|J9-1
|J9-1
|J9-1
|J9-1
Line 19: Line 19:
|-  
|-  
|D1
|D1
-
|P_
+
|P6_4
|J9-2
|J9-2
|J9-2
|J9-2
|S2-4
|S2-4
|S2-4
|S2-4
 +
|-
 +
|D2
 +
|P1_7
 +
|J9-3
 +
|J9-3
 +
|S3-7
 +
|S3-7
|-  
|-  
|D3
|D3
-
|P_
+
|P4_0
|J9-3
|J9-3
|J9-3
|J9-3
Line 33: Line 40:
|-  
|-  
|D4
|D4
-
|P_
+
|P6_9
|J9-4
|J9-4
|J9-4
|J9-4
Line 40: Line 47:
|-  
|-  
|D5
|D5
-
|P_
+
|P5_5
|J9-5
|J9-5
|J9-5
|J9-5
Line 47: Line 54:
|-  
|-  
|D6
|D6
-
|P_
+
|P5_7
|J9-6
|J9-6
|J9-6
|J9-6
Line 54: Line 61:
|-  
|-  
|D7
|D7
-
|P_
+
|P7_6
|J9-7
|J9-7
|J9-7
|J9-7
|S4-6
|S4-6
|S4-6
|S4-6
-
|-
 
-
|D0
 
-
|P_
 
-
|J9-1
 
-
|J9-1
 
-
|S2-5
 
-
|S2-5
 
|-  
|-  
|}
|}
-
Please see schematic below for further details.
+
 
 +
The following schematic can be used to build the circuit with a BAM210E or BAM210.
[[Image:BAM210_03_05_SCH.png|center|alt=BAM210|frame|<div align="center">'''Schematic for example 03-05''']]
[[Image:BAM210_03_05_SCH.png|center|alt=BAM210|frame|<div align="center">'''Schematic for example 03-05''']]

Revision as of 17:51, 17 September 2014

This example demonstrates the BusOut function to display digits on a 7-segment display with a common cathode. It displays digits 0, 1, 2, 3 in turn.

The signals used for this example are listed below:

Signals Used and Connector Locations for Example 03-05
Signal LPC4330 PIN NAME BAM210E BAM210 BAM200E BAM200
D0 P6_5 J9-1 J9-1 S2-5 S2-5
D1 P6_4 J9-2 J9-2 S2-4 S2-4
D2 P1_7 J9-3 J9-3 S3-7 S3-7
D3 P4_0 J9-3 J9-3 S3-7 S3-7
D4 P6_9 J9-4 J9-4 S8-7 n/p
D5 P5_5 J9-5 J9-5 S3-8 S3-8
D6 P5_7 J9-6 J9-6 S3-9 S3-9
D7 P7_6 J9-7 J9-7 S4-6 S4-6

The following schematic can be used to build the circuit with a BAM210E or BAM210.

BAM210
Schematic for example 03-05
/*Program Example 3.5: Simple demonstration of 7-segment display. Display digits 0, 1, 2, 3 in turn.
                                                                       */
#include "mbed.h"
BusOut display(D0,D1,D2,D3,D4,D5,D6,D7);   // segments a,b,c,d,e,f,g,dp

int main()
{
    while(1) {
        for(int i=0; i<4; i++) {
            switch (i) {
                case 0:
                    display = 0x3F;
                    break;       //display 0
                case 1:
                    display = 0x06;
                    break;       //display 1
                case 2:
                    display = 0x5B;
                    break;
                case 3:
                    display = 0x4F;
                    break;
            }                                      //end of switch
            wait(0.2);
        }                                        //end of for
    }                                          //end of while
}  

The following image shows the built circuit on a BAM210E.