digitalWrite() Write a HIGH або LOW value to a digital pin. Якщо pin має бути configured as OUTPUT with pinMode() , його параметр буде встановлювати відповідні значення: 5V (або 3.3V на 3.3V boards) for HIGH , 0V (ground) for LOW .

DigitalWrite() функція служить purpose of controlling the different digital devices connected to the Arduino by asigning the states of either HIGH or LOW to pins of Arduino through which the devices are connected.

Digitalwrite turns on(high) and off(low) ваші leds. DigitalRead reads the button voltage (high = не pressed, low = pressed). Input_pullup sets the internal pullup resistor so that it reads HIGH while the button is not pressed. Якщо ви натискаєте клавішу, її отримувати клацнути в зоні, і DigitalRead sees it as LOW.