Final

Dependencies:   mbed

Fork of MiniProject5_LightTracker by Austin Sloop

Committer:
asloop18
Date:
Mon Jan 11 21:44:09 2016 +0000
Revision:
2:d50d55831d50
Parent:
1:8e14c2404f45
Child:
3:4a3e2dbc111e
Disp;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pstephens18 1:8e14c2404f45 1 #include "SegDisplay.h"
asloop18 2:d50d55831d50 2 BusOut Display(p5,p6,p7,p8,p9,p10,p11,p12);
asloop18 2:d50d55831d50 3
pstephens18 1:8e14c2404f45 4
pstephens18 1:8e14c2404f45 5 void SegInit(void)
pstephens18 1:8e14c2404f45 6 {
pstephens18 1:8e14c2404f45 7 Seg1 = SegConvert(0);
asloop18 2:d50d55831d50 8
pstephens18 1:8e14c2404f45 9 }
pstephens18 1:8e14c2404f45 10
pstephens18 1:8e14c2404f45 11 char SegConvert(char SegValue)
pstephens18 1:8e14c2404f45 12 {
pstephens18 1:8e14c2404f45 13 char SegByte = 0x00;
asloop18 2:d50d55831d50 14 switch(SegValue){
pstephens18 1:8e14c2404f45 15 case 0: SegByte = 0x3F; break;
pstephens18 1:8e14c2404f45 16 case 1: SegByte = 0x06; break;
pstephens18 1:8e14c2404f45 17 case 2: SegByte = 0x5B; break;
pstephens18 1:8e14c2404f45 18 case 3: SegByte = 0x4F; break;
pstephens18 1:8e14c2404f45 19 case 4: SegByte = 0x66; break;
pstephens18 1:8e14c2404f45 20 case 5: SegByte = 0x6D; break;
pstephens18 1:8e14c2404f45 21 case 6: SegByte = 0x7D; break;
pstephens18 1:8e14c2404f45 22 case 7: SegByte = 0x07; break;
pstephens18 1:8e14c2404f45 23 case 8: SegByte = 0x7F; break;
pstephens18 1:8e14c2404f45 24 case 9: SegByte = 0x6F; break;
pstephens18 1:8e14c2404f45 25 }
pstephens18 1:8e14c2404f45 26 return SegByte;
pstephens18 1:8e14c2404f45 27 }