المشاركات

عرض المشاركات من أبريل, 2024

الكود البرمجي لبرمجة جهاز التحكم الدقيق

// C++ code // #include <Adafruit_LiquidCrystal.h> #include <Keypad.h> #include <Servo.h> Adafruit_LiquidCrystal lcd(0); Servo servo; const byte numRow = 4 ; const byte numCols = 4 ; char keymap [numRow][numCols] = {   {'1','2','3','A'},   {'4','5','6','B'},   {'7','8','9','C'},   {'*','0','#','D'},   }; byte rowPins[numRow] = {9,8,7,6};   byte colPins[numCols] = {5,4,3,2};   Keypad keypad =   Keypad (makeKeymap(keymap),rowPins , colPins ,numRow ,numCols); char password[4]; void setup() {     servo.attach(11);   servo.write(0);   lcd.begin(16,2);   lcd.setCursor(0,0);   lcd.print("set 4 character ");   lcd.setCursor(0,1);   lcd.print("password: ");   for (int i = 0 ; i<4 ; i++){     password[i]= keypad.waitForKey();   } }   void loop () {   lc...