Procházet zdrojové kódy

Änderung der Adressierung

Tobias Müller před 6 roky
rodič
revize
ae778545b9
1 změnil soubory, kde provedl 12 přidání a 3 odebrání
  1. 12 3
      HSA_LCD_Shield.cpp

+ 12 - 3
HSA_LCD_Shield.cpp

@@ -182,6 +182,9 @@ HSA_LCD_Shield::HSA_LCD_Shield(byte version, const char config[CONFIG_SIZE]) {
   // Save LCD-Shield version
   this->__version = version;
 
+  // Save standard I²C-Address for LC-Display
+  this->__i2cAddress = I2C_ADDRESS;
+
   // Save the configuration of Buttons/LEDs
   strcpy(this->__config,config);
 
@@ -195,6 +198,9 @@ HSA_LCD_Shield::HSA_LCD_Shield(byte version) {
   // Save LCD-Shield version
   this->__version = version;
 
+  // Save standard I²C-Address for LC-Display
+  this->__i2cAddress = I2C_ADDRESS;
+
   // Save the configuration of Buttons/LEDs
   strcpy(this->__config,CONFIG_L1B1);
 
@@ -208,6 +214,9 @@ HSA_LCD_Shield::HSA_LCD_Shield(const char config[CONFIG_SIZE]){
   // Save LCD-Shield version
   this->__version = LCD_VERSION_6;
 
+  // Save standard I²C-Address for LC-Display
+  this->__i2cAddress = I2C_ADDRESS;
+
   // Save the configuration of Buttons/LEDs
   strcpy(this->__config,config);
 
@@ -221,6 +230,9 @@ HSA_LCD_Shield::HSA_LCD_Shield(){
   // Save LCD-Shield version
   this->__version = LCD_VERSION_6;
 
+  // Save standard I²C-Address for LC-Display
+  this->__i2cAddress = I2C_ADDRESS;
+
   // Save the configuration of Buttons/LEDs
   strcpy(this->__config,CONFIG_L1B1);
 
@@ -242,9 +254,6 @@ HSA_LCD_Shield::~HSA_LCD_Shield(void) {
 
 bool HSA_LCD_Shield::begin(void) {
 
-  // Save standard I²C-Address of LC-Display
-  this->__i2cAddress = I2C_ADDRESS;
-
   // Configure GPIOs and exit
   return __gpioConfig();