Version 2.1 of TextLCD_SB1602E (forked).

Dependents:   BME280_environmental_recorder kids_workshop

Fork of SB1602E by Tedd OKANO

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Sat Jul 23 14:27:20 2016 +0000
Parent:
3:c4216ef28143
Commit message:
Add reset sequence

Changed in this revision

SB1602E.cpp Show annotated file Show diff for this revision Revisions of this file
SB1602E.h Show annotated file Show diff for this revision Revisions of this file
diff -r c4216ef28143 -r f2fb19e5486f SB1602E.cpp
--- a/SB1602E.cpp	Fri Jan 29 15:00:47 2016 +0000
+++ b/SB1602E.cpp	Sat Jul 23 14:27:20 2016 +0000
@@ -30,12 +30,12 @@
 #include    "SB1602E.h"
 
 
-SB1602E::SB1602E( PinName I2C_sda, PinName I2C_scl, char *init_massage ) : i2c_p( new I2C( I2C_sda, I2C_scl ) ), i2c( *i2c_p ), charsInLine( MaxCharsInALine )
+SB1602E::SB1602E( PinName I2C_sda, PinName I2C_scl, PinName reset, char *init_massage ) : i2c_p( new I2C( I2C_sda, I2C_scl )), i2c( *i2c_p ), rst_p(new DigitalOut(reset)), rst(*rst_p), charsInLine( MaxCharsInALine )
 {
     init( init_massage );
 }
 
-SB1602E::SB1602E( I2C &i2c_, char *init_massage ) : i2c_p( NULL ), i2c( i2c_ ), charsInLine( MaxCharsInALine )
+SB1602E::SB1602E( I2C &i2c_, char *init_massage ) : i2c_p( NULL ), i2c( i2c_ ), rst_p(NULL), rst(*rst_p), charsInLine( MaxCharsInALine )
 {
     init( init_massage );
 }
@@ -69,6 +69,10 @@
 
     wait( 0.04 );    //    interval after hardware reset
 
+    rst = 0;
+    wait(0.1);
+    rst = 1;
+    
     for ( int i = 0; i < sizeof( init_seq0 ); i++ ) {
         lcd_command( init_seq0[ i ] );
         wait( 30e-6 );
diff -r c4216ef28143 -r f2fb19e5486f SB1602E.h
--- a/SB1602E.h	Fri Jan 29 15:00:47 2016 +0000
+++ b/SB1602E.h	Sat Jul 23 14:27:20 2016 +0000
@@ -61,7 +61,7 @@
      * @param I2C_scl I2C-bus SCL pin
      * @param init_massage string to initialize the LCD
      */
-    SB1602E( PinName I2C_sda, PinName I2C_scl, char *init_massage = NULL );
+    SB1602E( PinName I2C_sda, PinName I2C_scl, PinName reset, char *init_massage = NULL );
 
     /** Create a PCA9629A instance connected to specified I2C pins with specified address
      *
@@ -177,6 +177,8 @@
     int     lcd_data( char data );
     I2C     *i2c_p;
     I2C     &i2c;
+    DigitalOut *rst_p;
+    DigitalOut &rst;
     char    i2c_addr;
     char    charsInLine;