Ghz2000's 14Segment LED Display Library

Dependents:   Nucleo_Seg14Display

Ghz2000製 14セグ表示器

http://ghz2000.dip.jp/wordpress/?p=665

mbed用のサンプルプログラムです。 ライブラリ化してあるので、インポートして使用することが出来ます。

注意事項

一度に読み込めるテキストは30文字です。 それを超えると変な文字が表示されます。

今後

スクロールが終わった時のコールバックを作って、30文字以上の文字列も流せるようにしたいです。 スイッチサイエンスほかで販売予定。

Revision:
1:ad058e8ade73
Parent:
0:e64e0d7aad81
--- a/lib14Seg.hpp	Tue Jul 05 05:59:05 2016 +0000
+++ b/lib14Seg.hpp	Tue Jul 05 07:22:08 2016 +0000
@@ -1,6 +1,22 @@
+/** Ghz2000 Seg14Display Class
+*  Used for showing Alphanumelic LED 14 Segment Display.
+*
+* Example:
+* @code
+* #include "mbed.h"
+* #include "lib14Seg.hpp"
+*
+* int main(){
+*  LED14Seg.init(SPI_MOSI, SPI_MISO, SPI_SCK, RCK, 0x04, 8);
+*
+*  LED14Seg.setChar("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+*  LED14Seg.showStop();
+*  LED14Seg.setScrollSpeed(300);
+*  while(1){};
+* }
+* @endcode
+*/
 
-/***********
-***********/
 
 #ifndef _lib14Seg_
 #define _lib14Seg_
@@ -120,36 +136,40 @@
 
 class C14Segment{
 private:
-  uint16_t m_view[8];
-  uint16_t m_str[__LEN];
-  static const uint16_t ascii[];
-  PinName m_RCK;
-  PinName m_MOSI;
-  PinName m_MISO;
-  PinName m_SCK;
-  int m_kido;
-  int m_ViewLength;
-  int m_speed;
-  
-  SPI *mp_SPIdevice;
-  DigitalOut *mp_DigitalOutRCK;
-  
+    uint16_t m_view[8];
+    uint16_t m_str[__LEN];
+    static const uint16_t ascii[];
+    PinName m_RCK;
+    PinName m_MOSI;
+    PinName m_MISO;
+    PinName m_SCK;
+    int m_kido;
+    int m_ViewLength;
+    int m_speed;
+
+    SPI *mp_SPIdevice;
+    DigitalOut *mp_DigitalOutRCK;
+
 
 public:
-  C14Segment();
-  void init(PinName SPI_MOSI, PinName SPI_MISO, PinName SPI_SCK, PinName RCK, int kido, int ViewLength);
-  void update();
-  void setChar(char *);
-  void putnum();
-  void cls();
-  void showStop();
-  void scroll();
-  void setSPI(PinName MOSI, PinName MISO, PinName SCK, PinName RCK);
-  void setBlight(int kido);
-  void setViewLength(int ViewLength);
-  void setScrollSpeed(int scrollSpeed);
-  void showCycleX();
-  void showCycleO();
+    C14Segment();
+        /** Initialize
+     *
+     * @retval void
+     */
+    void init(PinName SPI_MOSI, PinName SPI_MISO, PinName SPI_SCK, PinName RCK, int kido, int ViewLength);
+    void update();
+    void setChar(char *);
+    void putnum();
+    void cls();
+    void showStop();
+    void scroll();
+    void setSPI(PinName MOSI, PinName MISO, PinName SCK, PinName RCK);
+    void setBlight(int kido);
+    void setViewLength(int ViewLength);
+    void setScrollSpeed(int scrollSpeed);
+    void showCycleX();
+    void showCycleO();
 
 };