InetrfaceProducts NXP / PCA9622_LED8x8

Dependents:   PCA9622_LED8x8_Demo PCA9622_LED8x8_Hello PCA9622_LED8x8_x6_Demo shake-shake-machine

Revision:
1:a1bf164ff73b
Parent:
0:41234a8149bd
Child:
2:cd00372373e4
diff -r 41234a8149bd -r a1bf164ff73b PCA9622_LED8x8.cpp
--- a/PCA9622_LED8x8.cpp	Fri Nov 28 10:51:15 2014 +0000
+++ b/PCA9622_LED8x8.cpp	Thu Dec 25 01:51:30 2014 +0000
@@ -18,8 +18,6 @@
 #include    "mbed.h"
 #include    "PCA9622_LED8x8.h"
 
-Ticker  t;
-
 PCA9622_LED8x8::PCA9622_LED8x8( PinName sda, PinName scl, char slave_adr, float fr )
     :
     i2c_p( new I2C( sda, scl ) ), 
@@ -27,6 +25,7 @@
     address( slave_adr ),
     framerate( fr ),
     in_operation( false ),
+    line_counter( 0 ),
     frame_counter( 0 ),
     buffer_switch_request( false ),
     outgoing_buffer( 0 )
@@ -41,6 +40,7 @@
     address( slave_adr ),
     framerate( fr ),
     in_operation( false ),
+    line_counter( 0 ),
     frame_counter( 0 ),
     buffer_switch_request( false ),
     outgoing_buffer( 0 )
@@ -62,6 +62,8 @@
     i2c.frequency( 400 * 1000 );
     i2c.write( address, init[ 0 ], sizeof( init[ 0 ] ) );
     i2c.write( address, init[ 1 ], sizeof( init[ 1 ] ) );
+    
+    start();
 }
 
 void PCA9622_LED8x8::frame_rate( float rate )
@@ -91,7 +93,6 @@
 
 void PCA9622_LED8x8::draw_a_line( void )
 {
-    static int  line_counter    = 0;
     char        write_data[ 13 ];
 
     if ( buffer_switch_request && !line_counter ) {