-->
Page 1 of 8

SOLVED : read33vdd function

PostPosted: Tue Apr 14, 2015 5:43 am
by AcmeUK
WARNING : readvdd33 function should no longer be used

The readvdd33 function is now causing intermittent stack dumps. For info on alternative see this post http://www.esp8266.com/viewtopic.php?f=32&t=4894
----------------------------------------------------------------------------------------------------------------------------------

Those of us trying to develop battery powered esp8266 sensors need to monitor the battery state.

In the esp8266 SDK there is an undocumented call, read33vdd, which gives the value of the power supply input.

Is there any plan to include a call to read33vdd in the Arduino IDE?

Thanks of all the good work with the Arduino IDE for ESP8266.
----------------------------------------------------------------------------------------------------------------------------
My thanks to all who have contributed to this thread.
I think that the posting by gerardwr of the updated version of his ESP8266SDK2.ino (post #14591 near bottom of second page of this thread) completes our hunt for readvdd33.

Re: read33vdd function

PostPosted: Tue Apr 14, 2015 12:30 pm
by chadouming
I added "uint16 readvdd33(void);" to the sdk include user_interface.h, then imported the header as a "C" header and it works fine.

Re: read33vdd function

PostPosted: Tue Apr 14, 2015 3:49 pm
by AcmeUK
Hi

That is interesting.

For us "C" novices could you show us some code?

Thanks

Re: read33vdd function

PostPosted: Tue Apr 14, 2015 5:03 pm
by chadouming
add this :

extern "C" {
uint16 readvdd33(void);
}

At the top of your program should allow you to use the function.

You can also add :

extern "C" {
#include "user_interface.h"
uint16 readvdd33(void);
}

To have access to the sdk functions.