Scan() public static method

public static Scan ( Cpu pin ) : Device[]
pin Microsoft.SPOT.Hardware.Cpu
return Device[]
Ejemplo n.º 1
0
 public Ds18B20(OneWire ow, OneWireBus.Device dev)
 {
     m_ow = ow;
     if (dev == null)
     {
         var devs = OneWireBus.Scan(ow, OneWireBus.Family.DS18B20);
         if (devs == null || devs.Length < 1)
         {
             throw new InvalidOperationException("No DS18B20 devices found on OneWire bus");
         }
         dev = devs[0];
     }
     m_dev = dev;
 }
Ejemplo n.º 2
0
 public Ds18B20(Cpu.Pin pin, OneWireBus.Device dev)
 {
     m_op = new OutputPort(pin, false);
     m_ow = new OneWire(m_op);
     if (dev == null)
     {
         var devs = OneWireBus.Scan(m_ow, OneWireBus.Family.DS18B20);
         if (devs == null || devs.Length < 1)
         {
             throw new InvalidOperationException("No DS18B20 devices found on OneWire bus");
         }
         dev = devs[0];
     }
     m_dev = dev;
 }