DS2450
Inhaltsverzeichnis
Level 2 Überschrift
1w ds2450 power 1 (drei adrig) 1w ds2450 res c 08 (00 / 10 = 16bit, 08 8bit) 1w ds2450 oe c 0 (als eingang stetzen) 1w ds2450 range c 1 (Range 0-5,10V) 1w ds2450 convert $Srh = ($Vad - 0.958062) * 34.558; //Werte nach Kalibrierung
Level 2 Überschrift
„ecmd?1w list“ ergibt den rom code 20686414000000b5 für den ds2450
C6_HEADER(`/* This will be in control6.h */') #include "hardware/onewire/ds2450.h" uint16_t counter1 = 0; uint16_t var1 = 0; CONTROL_START CLOCK_USED() THREAD(start) var1 = 1; WAIT(5) var1 = 0; WAIT(5) THREAD_END(start) TCP_HANDLER_PERSIST(message_handler); if (var1 == 1){ ow_rom_code_t rom_code; uint16_t result; rom_code.bytewise[0] = 0x20; rom_code.bytewise[1] = 0x68; rom_code.bytewise[2] = 0x64; rom_code.bytewise[3] = 0x14; rom_code.bytewise[4] = 0x00; rom_code.bytewise[5] = 0x00; rom_code.bytewise[6] = 0x00; rom_code.bytewise[7] = 0xb5; ow_ds2450_convert(&rom_code, 0x0f, 0x00); ow_ds2450_get(&rom_code, 2, 2, &result); TCP_SEND("%u", result); WAIT(15) } TCP_HANDLER_END(); ON STARTUP DO THREAD_START(start) TCP_CONNECT(192.168.123.106, 4445, message_handler); END CONTROL_END
Notiz für mich: ;)
C6_HEADER(`/* This will be in control6.h */') #include "hardware/onewire/ds2450.h" uint16_t counter1 = 0; uint16_t var1 = 0; uint16_t var2 = 0; uint16_t result; CONTROL_START CLOCK_USED() THREAD(send) ow_rom_code_t rom_code; rom_code.bytewise[0] = 0x20; rom_code.bytewise[1] = 0x68; rom_code.bytewise[2] = 0x64; rom_code.bytewise[3] = 0x14; rom_code.bytewise[4] = 0x00; rom_code.bytewise[5] = 0x00; rom_code.bytewise[6] = 0x00; rom_code.bytewise[7] = 0xb5; ow_ds2450_convert(&rom_code, 0x0f, 0x00); ow_ds2450_get(&rom_code, 2, 2, &result); if (result < 1000) { var2 = 1; WAIT(10) var2 = 0; }else{ var2 = 0; } WAIT(1) THREAD_END(send) TCP_HANDLER_PERSIST(message_handler); if (var2 == 1){ TCP_SEND("ALARM"); WAIT(1) } TCP_HANDLER_END(); ON STARTUP DO THREAD_START(send) TCP_CONNECT(192.168.123.106, 4445, message_handler); END CONTROL_END