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;
		}
		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;
		}
Example #3
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;
 }
Example #4
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;
 }