Alphanumeric LED display, 8 digits, 5x7 pattern. Supports 8x1, 8x2, 16x1 and 16x2 display configuration.

Dependents:   mbed_HCMS2975

Alphanumeric LED display, 8 digits, 5x7 LED pattern. The device has SPI interface. The library supports multiple devices connected in a daisy chain. This provides a 8x1, 8x2, 16x1 and 16x2 display configuration.The library methods are similar to those used for the LCDText library.

/media/uploads/wim/hcms2975.jpg

These displays are from mid 80s to mid 90s and they look cool, but they are rather expensive ($100 a piece..). The lib was developed and tested with displays salvaged from some equipment. You see them mostly in HP printers, medical equipment etc.

Some info can be found here and here.

Datasheet is here

Files at this revision

API Documentation at this revision

Comitter:
wim
Date:
Mon Jan 05 20:37:06 2015 +0000
Parent:
0:a332431006fb
Commit message:
Fixed setBrightness() at init()

Changed in this revision

HCMS2975.cpp Show annotated file Show diff for this revision Revisions of this file
HCMS2975.h Show annotated file Show diff for this revision Revisions of this file
diff -r a332431006fb -r f46d90374eb2 HCMS2975.cpp
--- a/HCMS2975.cpp	Wed Oct 15 16:46:12 2014 +0000
+++ b/HCMS2975.cpp	Mon Jan 05 20:37:06 2015 +0000
@@ -5,6 +5,8 @@
  * @date   Copyright (c) 2014
  *         v01: WH, Initial release
  *              Info available at http://playground.arduino.cc/Main/LedDisplay and http://www.pjrc.com/teensy/td_libs_LedDisplay.html 
+ *         v02: WH, added getVersion()  
+ *         v03: WH, fixed setBrightness at init() when there is no HW reset.   
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -192,7 +194,7 @@
 
 /** Return the number of columns
   *
-  * @param return  The number of columns
+  * @return int The number of columns
   */   
 int HCMS2975::columns() {
     
@@ -203,7 +205,7 @@
 
 /** Return the number of rows
   *
-  * @param return  The number of rows
+  * @return int The number of rows
   */
 int HCMS2975::rows() {
 
@@ -293,9 +295,9 @@
   _spi->format(8,0);
   _spi->frequency(1000000);    // Max SCL is 5 MHz for HCMS2975
 //  _spi->frequency(50000);    // Max SCL is 5 MHz for HCMS2975
-  
-  //Clear display
-  cls();
+
+  //Set display to serial mode
+  _writeCommand(HCMS2975_CONTROL1 | HCMS2975_PRE_1 | HCMS2975_SERIAL);
 
   // default display brightness and peak
   _brightness = HCMS2975_DEF_BRIGHT;
@@ -304,6 +306,8 @@
   //Set display to normal
   _writeCommand(HCMS2975_CONTROL0 | HCMS2975_NORMAL | _peak | _brightness);
 
+  //Clear display
+  cls();
 } 
  
  
@@ -429,11 +433,10 @@
   return -1;    
 }
 
-#if(0)
+
 /** Returns the version number of the library
   * @return int version number
   */
 int HCMS2975::getVersion() {
-  return HCMS2975_VERSION    
+  return HCMS2975_VERSION;
 }
-#endif
\ No newline at end of file
diff -r a332431006fb -r f46d90374eb2 HCMS2975.h
--- a/HCMS2975.h	Wed Oct 15 16:46:12 2014 +0000
+++ b/HCMS2975.h	Mon Jan 05 20:37:06 2015 +0000
@@ -5,6 +5,8 @@
  * @date   Copyright (c) 2014
  *         v01: WH, Initial release, 
  *              Info available at http://playground.arduino.cc/Main/LedDisplay and http://www.pjrc.com/teensy/td_libs_LedDisplay.html
+ *         v02: WH, added getVersion(), 
+ *         v03: WH, fixed setBrightness at init() when there is no HW reset.    
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +34,7 @@
 //Enable Stream printf or minimalistic printf
 #define HCMS2975_PRINTF     1
 
-#define HCMS2975_VERSION    1
+#define HCMS2975_VERSION    2
 
 //Max supported display is 16x2
 #define HCMS2975_BUFFER_SIZE         32
@@ -70,9 +72,9 @@
 
 // D4.D5 selects max peak current
 #define HCMS2975_PEAK_12_8         0x30
-#define HCMS2975_PEAK_9_3          0x20
+#define HCMS2975_PEAK_9_3          0x00
 #define HCMS2975_PEAK_6_4          0x10
-#define HCMS2975_PEAK_4_0          0x00
+#define HCMS2975_PEAK_4_0          0x20
 
 // display brightness definitions, indicating percentage brightness
 // D3..D0 select brightness
@@ -200,7 +202,7 @@
      * @param  *spi SPI port
      * @param  cs   PinName for Chip Select (active low)
      * @param  rs   PinName for RS ()
-     * @param  rst  PinName for Rst (active low, optional, default=NC)      
+     * @param  rst  PinName for Rst (active low, optional, default = NC)      
      * @param type  Sets the panel size (default = LED8x1)     
      */
    HCMS2975(SPI *spi, PinName cs, PinName rs, PinName rst = NC, LEDType type = LED8x1);
@@ -257,13 +259,13 @@
     
     /** Return the number of columns
       *
-      * @return  The number of columns
+      * @return int The number of columns
       */   
     int columns();
     
     /** Return the number of rows
       *
-      * @return  The number of rows
+      * @return int The number of rows
       */
     int rows();
     
@@ -282,16 +284,15 @@
     /** Set User Defined Characters (UDC)
      *
      * @param unsigned char c   The Index of the UDC (0..7)
-     * @param char *udc_data    The bitpatterns for the UDC (7 bytes of 5 significant bits for bitpattern)       
+     * @param char *udc_data    The bitpatterns for the UDC (5 bytes of 7 significant bits for bitpattern)       
      */
     void setUDC(unsigned char c, char *udc_data);   
 
-#if(0)
+
    /** Returns the version number of the library
      * @return int version number
      */
     int getVersion();
-#endif
     
 protected:
     /** Low level Reset method for controller