AbstractBeliefs

Untitled

Jun 10th, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.52 KB | None | 0 0
  1. /*
  2. TM1640.h - Library for TM1640.
  3.  
  4. Copyright (C) 2011 Ricardo Batista <rjbatista at gmail dot com>
  5.  
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the version 3 GNU General Public License as
  8. published by the Free Software Foundation.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17. */
  18.  
  19. #ifndef TM1640_h
  20. #define TM1640_h
  21.  
  22. #if defined(ARDUINO) && ARDUINO >= 100
  23.     #include "Arduino.h"
  24. #else
  25.     #include "WProgram.h"
  26. #endif
  27.  
  28. #include "TM16XX.h"
  29. #include "TM16XXFonts.h"
  30.  
  31. class TM1640 : public TM16XX
  32. {
  33.   public:
  34.     /** Instantiate a tm1640 module specifying the display state, the starting intensity (0-7) data and clock pins. */
  35.     TM1640(byte dataPin, byte clockPin, boolean activateDisplay = true, byte intensity = 7);
  36.     /** Clear the display */
  37.     virtual void clearDisplay();
  38.    
  39.     void setDisplayToDecNumber(unsigned long number, byte dots, boolean leadingZeros = true,
  40.         const byte numberFont[] = NUMBER_FONT);
  41.  
  42.   protected:
  43.     virtual void sendChar(byte pos, byte data, boolean dot);
  44.     void setDisplayToDecNumberAt(unsigned long number, byte dots, byte startingPos,
  45.         boolean leadingZeros, const byte numberFont[]);
  46. };
  47.  
  48. #endif
Advertisement
Add Comment
Please, Sign In to add comment