
Understand the conceptසංකල්පය තේරුම් ගන්න
A microcontroller executes a program and exchanges signals through pins. GPIO can be configured as input or output. An input should not be left floating. With an internal pull-up and a switch to ground, open reads HIGH and closed reads LOW on a suitable Arduino Uno input.
ක්ෂුද්ර පාලකය වැඩසටහනක් ක්රියාත්මක කර පින් හරහා සංඥා හුවමාරු කරයි. GPIO ආදාන හෝ ප්රතිදාන ලෙස සකසයි. pull-up ප්රතිරෝධයක් සහ GND වෙත ස්විචයක් ඇති විට විවෘත ස්විචය HIGH, වසා ඇති විට LOW කියවයි.
Worked exampleවිසඳූ උදාහරණය
pinMode(2, INPUT_PULLUP); then digitalRead(2) returns LOW when the switch is closed to GND.
pinMode(2, INPUT_PULLUP); පසු ස්විචය GND වෙත වසා ඇති විට digitalRead(2) LOW වේ.
Practice independentlyස්වාධීනව පුහුණු වන්න
Draw the switch circuit and write two rows of expected input/output. Use the existing digital lesson to test both states. Never connect a motor directly to a GPIO.
ස්විච පරිපථය ඇඳ ආදාන සහ ප්රතිදාන තත්ත්ව දෙක ලියන්න. ඩිජිටල් පාඩම භාවිතයෙන් පරීක්ෂා කරන්න. මෝටරයක් GPIO වෙත සෘජුව සම්බන්ධ නොකරන්න.
Virtual lab / අතථ්ය පරීක්ෂණාගාරය ↗Compare your reasoning (model answer)ඔබේ හේතු සමඟ සසඳන්න (උදාහරණ පිළිතුර)
Open → HIGH, closed → LOW; use a series resistor for a physical LED indicator. GPIO does not supply a motor directly.
විවෘත → HIGH, වසා → LOW. LED සඳහා ශ්රේණි ප්රතිරෝධයක් යොදන්න. GPIO මඟින් මෝටරයට සෘජුව බලය නොදෙන්න.
Knowledge checkදැනුම පරීක්ෂාව
Choose an answer first.