![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Final
Fork of MiniProject5_LightTracker by
Diff: SegDisplay.cpp
- Revision:
- 11:7b3d64a66efd
- Parent:
- 3:4a3e2dbc111e
- Child:
- 13:871d01d0d250
--- a/SegDisplay.cpp Mon Jan 11 22:46:35 2016 +0000 +++ b/SegDisplay.cpp Mon Jan 11 23:27:38 2016 +0000 @@ -2,6 +2,7 @@ BusOut Display(p5,p6,p7,p8,p9,p10,p11,p12); DigitalOut Display1(p16); DigitalOut Display10(p17); +DigitalOut Negative(p14); void SegInit(void) @@ -28,15 +29,21 @@ return SegByte; } -void SegDisplay(char x, char y) +void SegDisplay(int x, bool negative) { while(1) { + if(negative ==1){Negative =1;} + Display1 =1; - Display = SegConvert(x); + Display = SegConvert(x/10); + wait(.001); Display1=0; + Display10 = 1; - Display = SegConvert(y); + Display = SegConvert(x%10); + wait(.001); Display10=0; } } +