897 Byte hinzugefügt,
14:30, 9. Feb. 2016 ==Bild==
[[Datei:ky-003.jpg|358x358px|none]]
==Technische Daten / Kurzbeschreibung==
Chipsatz: DS18B20 | Kommunikationsprotokoll: 1-Wire<br /><br />9- 12Bit genaue Temperaturmessung im Meßbereich von –55°C bis +125°C
==Pin-Belegung==
[[Datei:3_S_V_G.png|none]]
==Codebeispiel Arduino==
<pre class="brush:cpp">
/*
KY-003 Hall magnetic switch
*/
int Led = 13 ; // define LED Interface
int SENSOR = 10 ; // define the Hall magnetic sensor interface
int val ; // define numeric variables val
void setup ()
{
pinMode (Led, OUTPUT) ; // define LED as output interface
pinMode (SENSOR, INPUT) ; // define the Hall magnetic sensor line as input
}
void loop ()
{
val = digitalRead (SENSOR) ; // read sensor line
if (val == LOW) // when the Hall sensor detects a magnetic field, Arduino LED lights up
{
digitalWrite (Led, HIGH);
}
{
digitalWrite (Led, LOW);
}
}
</pre>