Μετάβαση στο κύριο περιεχόμενο

Αναρτήσεις

Προβολή αναρτήσεων από Μάρτιος, 2025

Κουμπί (pushButton) pull up

 PushButton με pull up αντιστάτη Για το έργο αυτό θα χρειαστούμε ένα LED, ένα pushbutton, καλώδια, ένα αντιστάτη 220 Ω, έναν αντιστάτη 10 ΚΩ, ένα breadboard και ένα Arduino Uno To LED συνδέεται στη θύρα 13 που είναι  και το  BUILTIN LED // C++ code // int buttonState = 0 ; void setup () {   pinMode ( 2 , INPUT ) ;   pinMode ( LED_BUILTIN, OUTPUT ) ; } void loop () {   // read the state of the pushbutton   buttonState = digitalRead ( 2 ) ;   // check if pushbutton is pressed. if it is, the   // button state is HIGH   if ( buttonState == HIGH ) {     digitalWrite ( LED_BUILTIN, HIGH ) ;   } else {     digitalWrite ( LED_BUILTIN, LOW ) ;   }   delay ( 10 ) ; // Delay a little bit to improve simulation performance }