K Kapnula
🎛
Lekce 4 · třída 13+

Inputs: buttons and sensors — the board starts to feel

📖 Lekce ──▶ 🎯 Kvíz — vyber překlad ──▶ ✅ Lekce hotová
4 × 5 = 20

Until now the board only "spoke" — now it "listens". Button: pinMode(2, INPUT_PULLUP) — built-in resistor, fewer wires; pressed = LOW. Sensors: photoresistor (light), DHT11/DHT22 (temperature+humidity, ~€3), HC-SR04 (ultrasonic distance), PIR (motion), DS18B20 (precise temperature). Analog sensors → analogRead gives 0–1023. The logic never changes: read sensor → decide (if) → switch something.

🎛 The HC-SR04 measures distance by echo like a bat: ping → wait for echo → distance = time × speed of sound / 2. Accurate to 3 mm — for €3.
🎯
Vyzkoušej se!
Upevni téma trenérem — jako po hodině
Kvíz — vyber překlad → 🖨 Pracovní list
← Předchozí Další →
💶 EUR 🇺🇸 1.09 USD 🇷🇺 90.17 RUB 🇵🇱 4.47 PLN 🇺🇦 49.40 UAH EZB · daily
⛽ Fuel E5 1.789€ E10 1.729€ Diesel 1.969€ Berlin · tankerkönig.de