|
|
@ -59,6 +59,16 @@ void main() |
|
|
|
while (1) { |
|
|
|
while (1) { |
|
|
|
last_signal = signal; |
|
|
|
last_signal = signal; |
|
|
|
signal = ow_reset(OW_PIN); |
|
|
|
signal = ow_reset(OW_PIN); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (signal) { |
|
|
|
|
|
|
|
ow_write(OW_PIN, 0x33); |
|
|
|
|
|
|
|
ow_read_arr(OW_PIN, addr, 8); |
|
|
|
|
|
|
|
// check if valid
|
|
|
|
|
|
|
|
if (addr[0] == 0x00 || (crc8(addr, 7) != addr[7])) { |
|
|
|
|
|
|
|
signal = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!signal) { |
|
|
|
if (!signal) { |
|
|
|
if (last_signal) { |
|
|
|
if (last_signal) { |
|
|
|
lcd_clear(); |
|
|
|
lcd_clear(); |
|
|
@ -70,9 +80,6 @@ void main() |
|
|
|
lcd_clear(); |
|
|
|
lcd_clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ow_write(OW_PIN, 0x33); |
|
|
|
|
|
|
|
ow_read_arr(OW_PIN, addr, 8); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Show chip type
|
|
|
|
// Show chip type
|
|
|
|
switch (addr[0]) { |
|
|
|
switch (addr[0]) { |
|
|
|
case 0x10: |
|
|
|
case 0x10: |
|
|
|