Re: 3.0 branch available for testing. Report bugs here.
Posted: Sun May 29, 2016 5:29 pm
You must download from the link at the beginning of this thread. It is not linked on the esp basic web site yet.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
sensors.requestTemperatures();
else if ( fname == F("temp") && num_args > 0 ) {
// function temp(sensor #)
// set return value
if(sensors.getAddress(tempDeviceAddress, args[0])) {
if( args[1] >= 9 && args[1] <= 12 ) { // optional argument to set resolution of DS18B20
sensors.setResolution(tempDeviceAddress, args[1]);
}
sensors.requestTemperatures();
*value = sensors.getTempC(tempDeviceAddress);
//sensors.getTempCByIndex(args[0]);
return PARSER_TRUE;
}
else
{
*value_str = "NO SENSOR";
return PARSER_STRING;
}
}
if ( Param0 == "temp" | Param0 == "ti")
{
valParam1 = GetMeThatVar(Param1).toInt();
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
sensors.requestTemperatures(); // Send the command to get temperatures
SetMeThatVar(Param2, String(sensors.getTempCByIndex(valParam1)), PARSER_STRING);
return;
}
if ( Param0 == "temp" | Param0 == "ti")
{
valParam1 = GetMeThatVar(Param1).toInt();
valParam3 = GetMeThatVar(Param3).toInt();
if(sensors.getAddress(tempDeviceAddress, valParam1)) {
if( valParam3 >= 9 && valParam3 <= 12 ) { //option resolution setting for DS18B20
sensors.setResolution(tempDeviceAddress, valParam3);
}
sensors.requestTemperatures();
SetMeThatVar(Param2, String(sensors.getTempC(tempDeviceAddress)), PARSER_STRING);
}
else
{
SetMeThatVar(Param2, String(F("NO SENSOR")), PARSER_STRING);
}
return;
}