LED Driver, 6 digits @ 8 segm, 8 LEDs, 16 Keys. SPI Interface

Dependents:   mbed_STLED316S

See here for more information.

Revision:
1:7a845a89625f
Parent:
0:2c5311a4f6fa
--- a/STLED316S.h	Sat Oct 01 15:09:51 2016 +0000
+++ b/STLED316S.h	Sat Oct 01 15:58:18 2016 +0000
@@ -33,36 +33,42 @@
  * @code
  * #include "mbed.h"
  * #include "STLED316S.h" 
- * 
- * DisplayData_t size is  8 bytes (4 grids @ 13 segments) OR 10 bytes (5 grids @ 12 segments) OR
- *                       12 bytes (6 grids @ 11 segments) OR 14 bytes (7 grids @ 10 segments) 
- * STLED316S::DisplayData_t mbed_str = {0xDA,0x00, 0x7C,0x00, 0x3C,0x01, 0xF6,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00};  
- * STLED316S::DisplayData_t all_str  = {0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F, 0xFF,0x0F};  
  *
- * // KeyData_t size is 5 bytes  
+ * DisplayData_t size is  1 bytes (1 grid @ 8 segments) thru 6 bytes (6 grids @ 8 segments)
+ * STLED316S::DisplayData_t all_str  = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};  
+ * STLED316S::DisplayData_t bye_str  = {LO(C7_B), LO(C7_Y), LO(C7_E), 0x00, 0x00, 0x00};
+ * STLED316S::LedData_t all_led  = {0xFF};  
+ *
+ * // KeyData_t size is 2 bytes  
  * STLED316S::KeyData_t keydata; 
  *
- * // STLED316S declaration, Default setting 7 Grids @ 10 Segments
+ * // STLED316S declaration, Default setting 6 Grids @ 8 Segments
  * STLED316S STLED316S(p5,p6,p7, p8);
  *
  * int main() {
+ *     
  *   STLED316S.cls(); 
  *   STLED316S.writeData(all_str);
- *   wait(4);
- *   STLED316S.writeData(mbed_str);    
+ *   STLED316S.writeLedData(all_led);    
+ *   wait(2);
+ *
+ *   STLED316S.setBrightMode(STLED316S::GlobalBright);  
+ *   STLED316S.setBrightness(STLED316S_BRT3);    
  *   wait(1);
- *   STLED316S.setBrightness(STLED316S_BRT0);
+ *   STLED316S.setBrightness(STLED316S_BRT0);        
  *   wait(1);
  *   STLED316S.setBrightness(STLED316S_BRT3);
  *
  *   while (1) {
  *    // Check and read keydata
  *    if (STLED316S.getKeys(&keydata)) {
- *      pc.printf("Keydata 0..4 = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\r\n", keydata[0], keydata[1], keydata[2], keydata[3], keydata[4]);
+ *      //pc.printf("Keydata 0..1 = 0x%02x 0x%02x\r\n", keydata[0], keydata[1]);
  *
- *      if (keydata[0] == 0x10) { //sw2   
- *        STLED316S.cls(); 
- *        STLED316S.writeData(all_str);
+ *      if (keydata[0] == 0x01) { // Key1&KS1
+ *        wait(1);
+ *        STLED316S.setLed(STLED316S_LED_L1);
+ *        wait(1);
+ *        STLED316S.clrLed(STLED316S_LED_L1);
  *      }  
  *    } 
  *   }