Änderungen

Aus Linkerkit.de

Wechseln zu: Navigation, Suche

LK-Temp2

1.100 Byte hinzugefügt, 14:39, 22. Feb. 2017
Die Seite wurde neu angelegt: „==Bild== [[Datei:LK-Temp2.jpg|500x500px|none]] ==Technische Daten / Kurzbeschreibung== Chipsatz: DS18B20 | Kommunikationsprotokoll: 1-Wire<br /><br />9- 12Bit…“
==Bild==
[[Datei:LK-Temp2.jpg|500x500px|none]]

==Technische Daten / Kurzbeschreibung==
Chipsatz: DS18B20 | Kommunikationsprotokoll: 1-Wire<br /><br />9- 12Bit genaue Temperaturmessung im Meßbereich von –55°C bis +125°C

==Codebeispiel Arduino==
<pre class="brush:cpp"># Include
OneWire ds (10); / / on pin 10
void setup (void) {
// Initialize inputs / outputs
// Start serial port
Serial.begin (9600);
}
void loop (void) {
byte i;
byte present = 0;
byte data [12];
byte addr [8];
int Temp;
if (! ds.search (addr)) {
// Serial.print ("No more addresses.");
ds.reset_search ();
return;
}
Serial.print ("R ="); // R = 28 Not sure what this is
for (i = 0; i <8; i ) {
Serial.print (addr [i], HEX);
Serial.print ("");
}
if (OneWire :: crc8 (addr, 7)! = addr [7]) {
Serial.print ("CRC is not valid!");
return;
}
if (addr [0]! = 0x28) {
Serial.print ("Device is not a DS18S20 family device.");
return;
}
ds.reset ();
}
</pre>

==Codebeispiel Raspberry==