-->
Page 2 of 2

Re: SPI and 1-wire

PostPosted: Fri Nov 06, 2015 6:47 pm
by Mmiscool
Added this to the current source.
Thank you so much. Need all the help possible.

I did how ever change the "ti"command a bit.

To keep with the convention for the other commands the identifier for the device is first. Then the variable to place the status in to.

Code: Select alltemp deviceNo variableName


Code: Select allif ( 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)));
    return;
  }

Re: SPI and 1-wire

PostPosted: Fri Nov 06, 2015 9:38 pm
by Rotohammer
Mmiscool wrote:I did how ever change the "ti"command a bit.

To keep with the convention for the other commands the identifier for the device is first. Then the variable to place the status in to.

Code: Select alltemp deviceNo variableName



That makes sense. Thanks for adding it in!