Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
ethersex:ds2450 [2016/03/29 06:54] – angelegt t33kanneethersex:ds2450 [Unknown date] (aktuell) – Externe Bearbeitung (Unknown date) 127.0.0.1
Zeile 1: Zeile 1:
 ====== DS2450 ====== ====== DS2450 ======
-  +===== Level 2 Überschrift ===== 
-  * http://old.ethersex.de/index.php/DS2450<br> + 
-  * http://hauptstrasse72.ath.cx/images/1wire/eigen_ds2450_v4.jpg<br> +  * http://old.ethersex.de/index.php/DS2450 
-  * http://code.google.com/p/picgps/source/browse/trunk/SGPS/Firmware/PIC18F67j50/App/MPX6115.c?r=10<br> +  * http://hauptstrasse72.ath.cx/images/1wire/eigen_ds2450_v4.jpg 
-  * http://www.ip-symcon.de/forum/f19/feuchtigkeit-sensor-5313/<br>+  * http://code.google.com/p/picgps/source/browse/trunk/SGPS/Firmware/PIC18F67j50/App/MPX6115.c?r=10 
 +  * http://www.ip-symcon.de/forum/f19/feuchtigkeit-sensor-5313/
   * http://patrikhermansson.se/files/ds2450-mpxa4115.png   * http://patrikhermansson.se/files/ds2450-mpxa4115.png
   * http://www.mikrocontroller.net/attachment/93009/ds2450.JPG   * http://www.mikrocontroller.net/attachment/93009/ds2450.JPG
Zeile 17: Zeile 18:
  
   * http://www.ip-symcon.de/forum/f30/1-wire-multifunktionssensor-fuer-temperatur-feuchte-9531/#post84034   * http://www.ip-symcon.de/forum/f30/1-wire-multifunktionssensor-fuer-temperatur-feuchte-9531/#post84034
 +
 +===== Level 2 Überschrift =====
 +
 +  * https://github.com/ethersex/ethersex/blob/master/hardware/onewire/ds2450.h
 +  * http://www.tutorials.at/c/03-dateneingabe-ausgabe.html
 +
 +\\
 +**"ecmd?1w list"** ergibt den rom code **20686414000000b5** für den ds2450\\
 +\\
 +<code>
 +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
 +</code>
 +
 + Notiz für mich:  ;)
 +
 +<code>
 +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
 +</code>
 +
 +