# u8glib 1.11 function SleepOn don't work.

**URL:** <https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129>\
**Category:** Displays\
**Created:** [February 24, 2013, 7:11pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129 "2013-02-24T19:11:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [February 24, 2013, 7:11pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/1 "2013-02-24T19:11:35Z")

</div>

Hi, sorry by my English, I'm from Spain. I'm doing an sketch with a LCD ST7565 128x64, I'm trying to use the functions "SleepON" and "SleepOff".

In the reference of U8glib this functions are avalaible since version 1.11. I'm using this constructor:

U8GLIB\_DOGM128 u8g(13, 11, 10, 9, 8);

When I compiled my sketch, it appears an error: 'class U8GLIB\_DOGM128' has no member named 'SleepOn'

I had search this member in all files in the library u8glib, but i dont found it.

Can you help me? Thanks.

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [February 24, 2013, 8:17pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/2 "2013-02-24T20:17:18Z")

</div>

Release 1.11 is not yet out. But I have just put another prerelease on the download page.  
Let me know if the sleep function works. I added it some hours ago.

Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [February 25, 2013, 7:39am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/3 "2013-02-25T07:39:56Z")

</div>

Thanks Olikraus, I'm pending.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 13, 2013, 11:14am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/4 "2013-03-13T11:14:03Z")

</div>

Hello Olikraus, I downloaded the version 1.11 ( u8glib\_arduino\_v1.11.zip ) at [Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/u8glib/downloads/list).

I read the news for 1.11: New release v1.11 is available for download:  
Support for T6963  
Support for Arduino Due  
**Sleep Mode**  
4x mode for ST7920  
New C++ interface for ST7920

but i not find how i have to do for use the function sleepon and sleepoff.  
I'm looking for text "sleepon" in all archives of library and I not find it.

Can you help me. Thanks.

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [March 15, 2013, 4:24pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/5 "2013-03-15T16:24:29Z")

</div>

Hi

Thanks for the hint. Procedure names are:

```cpp
    void U8GLIB::sleepOn(void)
    void U8GLIB::sleepOff(void)

```

I will add this to the reference manual.

Thanks,  
Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 15, 2013, 5:13pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/6 "2013-03-15T17:13:19Z")

</div>

Thanks, Oliver

I put the code in my sketch and when i compile it say me:

```cpp
ProAACon_V115.ino: In function 'void SCRApagaPantalla()':
ProAACon_V115:702: error: 'class U8GLIB_DOGM128' has no member named 'sleepOn'
ProAACon_V115.ino: In function 'void SCREnciendePantalla()':
ProAACon_V115:709: error: 'class U8GLIB_DOGM128' has no member named 'sleepOff'

```

My functions are:

```cpp
/////////////////////////////////////////////////////////////// 
// APAGAMOS LA PANTALLA
/////////////////////////////////////////////////////////////// 
void SCRApagaPantalla(){
  scru8g.sleepOn();  
}

/////////////////////////////////////////////////////////////// 
// ENCENDEMOS LA PANTALLA 
/////////////////////////////////////////////////////////////// 
void SCREnciendePantalla(){
  scru8g.sleepOff();  
}

```

All others funtions work fine, why those not?

Thanks again

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [March 16, 2013, 12:29am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/7 "2013-03-16T00:29:50Z")

</div>

ok, I have to investigate this more closely. I have currently only limited access to the u8glib project, but I hope to work on this topic next week.

Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 18, 2013, 8:51am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/8 "2013-03-18T08:51:30Z")

</div>

Hi, Oliver:

I found the function at file u8g\_ll\_api.c and the syntax are:

```cpp
void u8g_SleepOn(u8g_t *u8g)
{
  u8g_call_dev_fn(u8g, u8g->dev, U8G_DEV_MSG_SLEEP_ON, NULL);
}

void u8g_SleepOff(u8g_t *u8g)
{
  u8g_call_dev_fn(u8g, u8g->dev, U8G_DEV_MSG_SLEEP_OFF, NULL);
}

```

In te reference we have SleepOn and SleepOff not **u8g\_SleepOn** and **u8g\_SleepOff**. Maybe this is the matter?

I'll try later at home and i'll say you something.

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [March 18, 2013, 6:42pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/9 "2013-03-18T18:42:47Z")

</div>

These two procedures are part of the C interface. However the same procedure should be also available in the C++ interface.

Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 18, 2013, 7:09pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/10 "2013-03-18T19:09:35Z")

</div>

Hi, I tried at home and don't work, I don't know what is the matter. I'll continue looking for, but

If you found the bug please send me.

Thanks again.

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [March 19, 2013, 5:22am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/11 "2013-03-19T05:22:44Z")

</div>

Hi

I have added the following commands into the loop() procedure of the GraphicsTest example:

```cpp
  if ( (draw_state % 8) == 2 )
  u8g.sleepOn();
   
  if ( (draw_state % 8) == 3 )
  u8g.sleepOff();

```

Everything works as expected. I did not found any bug.

Why do you think that it is not working?  
Do you receive any warnings or compiler errors?  
Can you upload your code?

Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 19, 2013, 7:54am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/12 "2013-03-19T07:54:05Z")

</div>

Hello oliver,

I found my problem, not because reason though I copied the new library, compiled with the old

I deleted the directory \library\u8glib and I copied u8glib again. compiled ok. I not have arduino card now, I test at my home later.

I tell you if the function works

Thanks for all. 🙂

---

<div class="post-metadata">

**Author:** ![olikraus](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/olikraus/32/214084_2.png) [@olikraus](https://forum.arduino.cc/u/olikraus)\
**Post date:** [March 19, 2013, 7:48pm UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/13 "2013-03-19T19:48:19Z")

</div>

Glad to hear that your problem has been solved.

Oliver

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 3:25am UTC](https://forum.arduino.cc/t/u8glib-1-11-function-sleepon-dont-work/147129/14 "2021-05-06T03:25:32Z")

</div>

Closed on May 6, 2021, 3:25am UTC


