I am also getting the same error in the same location. TouchReset?? I do have a reference to Microsoft.SPOT.Hardware.OneWire in my project. Any help would be great.
I am running VS2012 with 4.3. Below is the code I am using. Just trying to get to work.
public static void Main()
{
// DS18B20, NETMF 4.2
// center pin is connected to digital pin 0, right pin is connected to 5V,
// left pin GND, 4k7 pull-up resistor between 5V and the center pin
OneWire oneWire = new OneWire(new OutputPort(Pins.GPIO_PIN_D0, false));
ushort temperature;
while (true)
{
if (oneWire.TouchReset() > 0)
{
oneWire.WriteByte(0xCC); // Skip ROM, we only have one device
oneWire.WriteByte(0x44); // Start temperature conversion
while (oneWire.ReadByte() == 0) ; // wait while busy
oneWire.TouchReset();
oneWire.WriteByte(0xCC); // Skip ROM
oneWire.WriteByte(0xBE); // Read Scratchpad
temperature = (byte)oneWire.ReadByte(); // LSB
temperature |= (ushort)(oneWire.ReadByte() << 8); // MSB
//Temperatu in C, If you will in F would be: ((1.80 * (temperature / 16.0)) + 32);
Debug.Print("Temperature: " + temperature / 16.0 + "C");
}
else
{
Debug.Print("No device detected");
}
Thread.Sleep(1000);
}
?
}