MD_Parola library waking up from sleep mode

Hi, Need some help waking up my MAX7219 8x32 display after sleep.

my sketch uses MD_Parola library with MD_Max7219XX. I am creating object using

MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

i am using sleep function of ATMEGA328P and CPU goes to sleep properly, but when it wakes up, the display is not initializes - shows blank. i am able to access serial from CPU after it wakes up, but display is blank after wakeup. tried P.begin(); on wakeup but its not working.
my sleep function disables following

    set_sleep_mode(SLEEP_MODE_PWR_SAVE);
    power_adc_disable(); // ADC converter
    power_spi_disable(); // SPI
    power_usart0_disable(); // Serial (USART)
    power_timer0_disable(); // Timer 0
    power_timer1_disable(); // Timer 1
    power_timer2_disable();// Timer 2
    power_twi_disable(); // TWI (I2C)

and waking up with sleep_disable(); and all module gets enabled properly.

PS: sleep uses standard sleep lib of Arduino.

found some function using control() method in MD_7219XX library, but unable to access it using P object.
I believe the scan limit of MAX7219 goes back to 0 or MAX7219 goes to powerdown mode. i want to access these .
Question is how the display can be initialized again after CPU comes out of sleep.

You can access a pointer to the MD_MAX72xx object through the getGraphicObject() method

  /**
  * Get a pointer to the instantiated graphics object.
  *
  * Provides a pointer to the MD_MAX72XX object to allow access to
  * the display graphics functions.
  *
  * \return Pointer to the MD_MAX72xx object used by the library.
  */
  inline MD_MAX72XX *getGraphicObject(void) { return(&_D); }

thanks marco_c i could able to access the MD_MAX72xx object now.

if anyone interested this is what i have done:
created object using:

MD_MAX72XX *pM;

in setup() initiated:

pM = P.getGraphicObject();

then used it in my function as:

pM->control(MD_MAX72XX::SHUTDOWN,0);
pM->control(MD_MAX72XX::SCANLIMIT,MAX_SCANLIMIT);  

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.