Exemplo n.º 1
0
        void ResetOneWireAndMatchDeviceRomAddress()
        {
            DS2482Channel.OneWireReset();

            DS2482Channel.OneWireWriteByte(RomCommand.MATCH);

            foreach (var item in OneWireAddress)
            {
                DS2482Channel.OneWireWriteByte(item);
            }
        }
Exemplo n.º 2
0
        byte[] ReadScratchpad()
        {
            DS2482Channel.OneWireWriteByte(FunctionCommand.READ_SCRATCHPAD);

            var scratchpadData = new byte[9];

            for (int i = 0; i < scratchpadData.Length; i++)
            {
                scratchpadData[i] = DS2482Channel.OneWireReadByte();
            }

            return(scratchpadData);
        }
Exemplo n.º 3
0
        void StartTemperatureConversion()
        {
            DS2482Channel.OneWireWriteByte(FunctionCommand.CONVERT_T);

            Task.Delay(TimeSpan.FromSeconds(1)).Wait();
        }