That page is too old and need to be updated. In 4.1, GHI had its own one wire but on 4.2 it is moved to be part of netmf core libs. We are in the process of updating all tutorials.
Not sure VS2012 + Netmf4.3 RTM SDK is a supported combination. That might be part of your problem.
I am not developing in 4.2 yet, so still using the 4.1 GHI-provided one-wire, but if you search here there are some other threads that talk about OW in 4.2 and there’s sample code there. I’ll be back with a new link shortly
And here is simple code in case you have only one device:
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHI.Premium.Hardware;
namespace one_wire_premium_42_libs_check
{
public class Program
{
public static void Main()
{
// Change this your correct pin!
OutputPort myPin = new OutputPort((Cpu.Pin)EMX.Pin.IO4, false);
OneWire ow = new OneWire(myPin);
ushort temperature;
// read every second
while (true)
{
if (ow.TouchReset() >0)
{
ow.WriteByte(0xCC); // Skip ROM, we only have one device
ow.WriteByte(0x44); // Start temperature conversion
while (ow.ReadByte() == 0) ; // wait while busy
ow.TouchReset();
ow.WriteByte(0xCC); // skip ROM
ow.WriteByte(0xBE); // Read Scratchpad
temperature = (byte)ow.ReadByte(); // LSB
temperature |= (ushort)(ow.ReadByte() << 8); // MSB
Debug.Print("Temperature: " + temperature / 16);
Thread.Sleep(1000);
}
else
{
Debug.Print("Device is not detected.");
}
Thread.Sleep(1000);
}
}
}
}
thanks all for the responses very impressed with the speed, got fed up and went to watch some Tv and i come back and i’ve got 6 reply s!
As ever the answer is obvious when you know it, its a separate DLL for OneWire, feel stupid now, though MSDN still doesn’t list it.
It would be great for newbies like me if the out of date tutorials were marked as such even if not updated or even had the netmf version number on them some where.