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:
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);
// read every second
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.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);
Debug.Print("Device is not detected.");
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.