Very simple library for controll a 7 segment display.

Dependents:   Demo_Led7seg TP1_EJER02_FERNANDEZ_CLERICI TP1_EJER3 Ejercicio3JalleVentiades ... more

Committer:
trombettamichele
Date:
Fri Apr 22 22:30:33 2011 +0000
Revision:
0:ccabe7ff24e8

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
trombettamichele 0:ccabe7ff24e8 1 #include "mbed.h"
trombettamichele 0:ccabe7ff24e8 2 #include "Led7Seg.h"
trombettamichele 0:ccabe7ff24e8 3
trombettamichele 0:ccabe7ff24e8 4 #define format_DEC 0
trombettamichele 0:ccabe7ff24e8 5 #define format_HEX 1
trombettamichele 0:ccabe7ff24e8 6 // Simple library that can controll a matrix of 7 segment led displays
trombettamichele 0:ccabe7ff24e8 7 // Created by Michele Trombetta
trombettamichele 0:ccabe7ff24e8 8 // Copyright 2010 5OFT. All rights reserved.
trombettamichele 0:ccabe7ff24e8 9
trombettamichele 0:ccabe7ff24e8 10 class Multi7Seg {
trombettamichele 0:ccabe7ff24e8 11 public:
trombettamichele 0:ccabe7ff24e8 12 Multi7Seg(PinName a, PinName b, PinName c, PinName d, PinName e, PinName f, PinName g, PinName disp1, PinName disp2, bool led_type);
trombettamichele 0:ccabe7ff24e8 13 Multi7Seg(PinName a, PinName b, PinName c, PinName d, PinName e, PinName f, PinName g, PinName disp1, PinName disp2, PinName disp3, bool led_type);
trombettamichele 0:ccabe7ff24e8 14 Multi7Seg(PinName a, PinName b, PinName c, PinName d, PinName e, PinName f, PinName g, PinName disp1, PinName disp2, PinName disp3, PinName disp4, bool led_type);
trombettamichele 0:ccabe7ff24e8 15 Multi7Seg(PinName a, PinName b, PinName c, PinName d, PinName e, PinName f, PinName g, PinName disp1, PinName disp2, PinName disp3, PinName disp4, PinName disp5, bool led_type);
trombettamichele 0:ccabe7ff24e8 16 void write(unsigned int number); // Write the number to the led displays
trombettamichele 0:ccabe7ff24e8 17 void setformat(bool format); // Set the format (0-Dec 1-Hex)
trombettamichele 0:ccabe7ff24e8 18 void setspeed(float speed); // Set the delay time for digits scanning
trombettamichele 0:ccabe7ff24e8 19
trombettamichele 0:ccabe7ff24e8 20 private:
trombettamichele 0:ccabe7ff24e8 21 BusOut _disps;
trombettamichele 0:ccabe7ff24e8 22 Led7Seg _led_7seg;
trombettamichele 0:ccabe7ff24e8 23 unsigned char _ndisp;
trombettamichele 0:ccabe7ff24e8 24 bool _format;
trombettamichele 0:ccabe7ff24e8 25 float _speed;
trombettamichele 0:ccabe7ff24e8 26 unsigned int _num1, _num2, _num3, _num4, _num5;
trombettamichele 0:ccabe7ff24e8 27 };