TM1618.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. TM1618.h - Library for TM1618.
  3. Copyright (C) 2011 Ricardo Batista <rjbatista at gmail dot com>
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the version 3 GNU General Public License as
  6. published by the Free Software Foundation.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef TM1618_h
  15. #define TM1618_h
  16. #if defined(ARDUINO) && ARDUINO >= 100
  17. #include "Arduino.h"
  18. #else
  19. #include "WProgram.h"
  20. #endif
  21. #include "TM16XX.h"
  22. #include "TM16XXFonts.h"
  23. class TM1618 : public TM16XX
  24. {
  25. public:
  26. /** Instantiate a TM1618 module specifying the display state, the starting intensity (0-7) data, clock and stobe pins. */
  27. TM1618(byte dataPin, byte clockPin, byte strobePin, byte displays, boolean activateDisplay = true,
  28. byte intensity = 7);
  29. /** Set the display (segments and LEDs) active or off and intensity (range from 0-7). */
  30. void setupDisplay(boolean active, byte intensity);
  31. /** Set the display intensity (range from 0-7). */
  32. void setIntensity(byte intensity);
  33. protected:
  34. virtual void sendChar(byte pos, byte data, boolean dot);
  35. };
  36. #endif