Very simple library for controll a 7 segment display.
Dependents: Demo_Led7seg TP1_EJER02_FERNANDEZ_CLERICI TP1_EJER3 Ejercicio3JalleVentiades ... more
Diff: Multi7Seg.h
- Revision:
- 0:ccabe7ff24e8
diff -r 000000000000 -r ccabe7ff24e8 Multi7Seg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Multi7Seg.h Fri Apr 22 22:30:33 2011 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "Led7Seg.h" + +#define format_DEC 0 +#define format_HEX 1 +// Simple library that can controll a matrix of 7 segment led displays +// Created by Michele Trombetta +// Copyright 2010 5OFT. All rights reserved. + +class Multi7Seg { +public: + Multi7Seg(PinName a, PinName b, PinName c, PinName d, PinName e, PinName f, PinName g, PinName disp1, PinName disp2, bool led_type); + Multi7Seg(PinName a, PinName b, PinName c, PinName d, PinName e, PinName f, PinName g, PinName disp1, PinName disp2, PinName disp3, bool led_type); + 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); + 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); + void write(unsigned int number); // Write the number to the led displays + void setformat(bool format); // Set the format (0-Dec 1-Hex) + void setspeed(float speed); // Set the delay time for digits scanning + +private: + BusOut _disps; + Led7Seg _led_7seg; + unsigned char _ndisp; + bool _format; + float _speed; + unsigned int _num1, _num2, _num3, _num4, _num5; +}; \ No newline at end of file