-->
Page 1 of 2

Sample analog read? Port?

PostPosted: Fri May 15, 2015 2:45 am
by bernd331
Hi,

stupid quesion... but what is the portnumber of analog in (TOUT)? If I make:

analog_value = analogread(A0);

I get only jumping values. Connected is a 10k potentiometer.

Thanks, Bernd

Re: Sample analog read? Port?

PostPosted: Fri May 15, 2015 3:38 am
by ReinholdHiller
Did you remember, ADC is from 0 to 1 Volts.

Re: Sample analog read? Port?

PostPosted: Fri May 15, 2015 5:52 am
by bernd331
Jep, I knew. 1V.

I use this code from another thread but the ESP8266 crashes after the 3 time querying the Voltage.

Code: Select allextern "C" {
#include "user_interface.h"
int readvdd33(void);

}

void setup(){
  Serial.begin(115200);

}

void loop(){
  Serial.print("[SDK direct] Chipid   : "); Serial.println(system_get_chip_id());

  Serial.print("[SDK direct] Heapsize : "); Serial.println(system_get_free_heap_size());

  Serial.print("[SDK direct] RTC time : "); Serial.println(system_get_rtc_time());

  int vdd33 = readvdd33();
  Serial.print("[SDK direct] Vdd33 : "); Serial.println(vdd33);


  delay(5000);
}


Currently I downloading the actual version of Arduino IDE and test with that... strange...

Greetz, Bernd

Re: Sample analog read? Port?

PostPosted: Fri May 15, 2015 6:04 am
by bernd331
No, also with the current Arduino IDE the ESP8266 crashes.

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 26644, room 16
tail 4
chksum 0x79
load 0x3ffe8000, len 2540, room 4
tail 8
chksum 0x68
load 0x3ffe89f0, len 1388, room 0
tail 12
chksum 0x55
csum 0x55
rÔ”[SDK direct] Chipid : 10362089
[SDK direct] Heapsize : 39968
[SDK direct] RTC time : 14879133
[SDK direct] Vdd33 : 3364
[SDK direct] Chipid : 10362089
[SDK direct] Heapsize : 39480
[SDK direct] RTC time : 15800857
[SDK direct] Vdd33 : 3365
[SDK direct] Chipid : 10362089
[SDK direct] Heapsize : 39480
[SDK direct] RTC time : 16727079

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

Somebody an idea?

Greetz, Bernd