تخطي للذهاب إلى المحتوى

Before any code, it helps to know what you are holding. An Arduino Uno is one small computer (the ATmega328P), a USB bridge that lets your laptop talk to it, a voltage regulator, and a row of pins that connect the chip to the outside world. That is genuinely all.

The three things a pin can be

Every pin is one of: an input reading a voltage, an output driving a voltage, or unused. The confusing part for beginners is that a pin does not know which it is until your code says so. That is what pinMode() is for.

pinMode(13, OUTPUT);   // pin 13 will drive a voltage
pinMode(2,  INPUT);    // pin 2 will read one

Why 5 V matters

The Uno runs at 5 V. HIGH means about 5 V, LOW means about 0 V. Feed a 5 V signal into a 3.3 V board like the ESP32 and you can damage it, which is the single most common way people kill their first board.

Next: we write the smallest program that proves the whole chain works.

Before any code, it helps to know what you are holding. An Arduino Uno is one small computer (the ATmega328P), a USB bridge that lets your laptop talk to it, a voltage regulator, a
التقييم
0 0

لا توجد تعليقات حالياً.

لتكون أول من يترك تعليقاً.

Shopping Cart
جارٍ التحميل...