Cov txheej txheem:
- Kauj ruam 1: Sijhawm Schematic
- Kauj ruam 2: Coding Sijhawm
- Kauj Ruam 3: Txhua Qhov No Puas Yog?
- Kauj ruam 4: Troubleshooting
- Kauj Ruam 5: Yog tias Koj Muaj Lus Nug, Ua Ntej Xav Nug Hauv Kab Lus Tawm thiab Nco ntsoov Sau Npe
Video: Keypad Servo Xauv: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Nyob zoo txhua tus, vam tias koj muaj hnub zoo. Yog tias tsis cia siab koj tuaj yeem rov qab nrog qee qhov qhib siab rau qhov kev qhia no thiab qee cov suab paj nruag kho. Programming tuaj yeem ua teeb meem. Ua tsaug, qhov kev qhia no tsis yog qhov nyuaj, yog li koj tuaj yeem muaj peev xwm ua tiav qhov nrov npe hu ua (hauv lub suab muaj zog): LUB KAWG KAWG KEYPAD XAUS KAWG !!! Qhov ntawd tsuas yog kuv qhov kev qhia, vam tias koj nyiam nws. Xijpeem, cia peb ua kom peb cov ntiv tes sov rau kev ntaus ntawv. (Ib zaj nkauj txias: tuaj yeem-tuaj yeem hu nkauj (suab paj nruag qub)).
Khoom siv:
Koj cov ntiv tes
-Koj txhais tes ib yam nkaus, qhov tseem ceeb
-USB cable rau Arduino
Txhua hom arduino muaj (Kuv muaj Arduino Mega)
-Matrix Keypad (keyboard - ebay, keypad - amazon)
-Micro lossis Standard servo (Kuv siv micro servo)
-* Yeem tau* Breadboard - txhua yam
-* Yeem* Fais fab mov (5V)
Kauj ruam 1: Sijhawm Schematic
Yog li, ua ntej dab tsi? Txuas tus Arduino mus rau lub khoos phis tawj. Txuas tus keypad tom ntej. *Nco tseg - koj yuav tsum txuas tus pin los ntawm tus lej kawg ntawm tus keyboard yog thawj tus lej digital ntawm arduino. Thiab mus ntawm sab xis mus rau sab laug tom qab ntawd*. Keypad muaj tus pin 2-9 ntawm arduino. Lub servo muaj tus pin 10 ua cov cim digital. Tie thaj tsam ntawm arduino, keypad, thiab servo thiab 5V ib yam nkaus. * Tseem ceeb - qhov kev pabcuam zoo tshaj plaws nrog lub zog siv sab nraud lossis lub adapter nrog 5V (phab ntsa ntsaws -hauv), tab sis nws tseem xaiv tau.* Koj tsis tas yuav khi thaj chaw thiab 5V lub cev, kuv txhais li cas yog kom tsuas yog txuas cov xov hlau los ntawm Arduino mus rau servo. Cov txheej txheem no tsis pab pib, yog li cia kuv piav qhia luv luv. Yeej, tus pin kawg yog 2 thiab thawj tus yog 9, ob yog 8, peb yog 7, thiab ntxiv rau. Mus ntawm sab laug mus rau sab xis 22.
Kauj ruam 2: Coding Sijhawm
Yog li tam sim no peb tab tom mus rau ntu coding! Nov yog qhov uas khawv koob tiag tshwm sim! Yog li, muaj qhov kev tshuaj ntsuam xyuas thawj zaug los ntsuas cov keyboard thiab servo. Ntawm no:
//www.elegoo.com//2016.12.9
/* @file CustomKeypad.pde
|| @kev 1.0 1.0 @author Alexander Brevig || @contact [email protected] || || @kev piav qhia || | Ua piv txwv hloov pauv qhov loj me thiab cov txiaj ntsig tseem ceeb. || # */ # suav nrog
const byte ROWS = 4; // plaub kab
const byte COLS = 4; // plaub kab // piav qhia cymbols ntawm cov nyees khawm ntawm cov keypads char hexaKeys [ROWS] [COLS] = {{'1', '2', '3', 'A'}, {'4', '5 ',' 6 ',' B '}, {' 7 ',' 8 ',' 9 ',' C '}, {'*',' 0 ','#',' D '}}; byte rowPins [ROWS] = {9, 8, 7, 6}; // txuas rau kab pinouts ntawm cov keyboard byte colPins [COLS] = {5, 4, 3, 2}; // txuas mus rau kab ntawv pinouts ntawm cov keyboard
// pib qhov piv txwv ntawm chav kawm NewKeypad
Keypad customKeypad = Keypad (uaKeymap (hexaKeys), rowPins, colPins, ROWS, COLS);
void teeb tsa () {
Serial.begin (9600); } void loop () {char customKey = customKeypad.getKey (); yog (customKey) {Serial.println (customKey); }}
//www.elegoo.com//2016.12.08 #suav nrog
Servo tswj; // tsim cov khoom siv servo los tswj lub servo
// kaum ob yam khoom siv servo tuaj yeem tsim tau ntawm cov laug cam
int pos = 0; // sib txawv los khaws txoj haujlwm servo
void teeb tsa () {
myservo.attach (9); // txuas cov servo ntawm tus pin 9 rau cov khoom siv servo}
void voj () {
rau (pos = 0; pos = 0; pos -= 1) {// mus los ntawm 180 degrees mus rau 0 degrees myservo.write (pos); // qhia servo mus rau txoj haujlwm hauv qhov sib txawv 'pos' ncua (15); // tos 15ms rau servo kom mus txog txoj haujlwm}}
Nov yog qhov phiaj xwm phiaj xwm (Kuv yuav ua ncaj ncees rau koj, Kuv tsis tau ua ntau yam, Kuv tsuas yog ntxiv qhov kev pabcuam, hais ua tsaug rau cov neeg uas ua txhua txoj cai!):
#suav nrog Password.h
#suav nrog Keypad
/*
|| Kev nkag tus lej nkag yooj yim Siv Matrix Keypad || 4/5/2012 Hloov Kho tshiab Nathan Sobieck: [email protected] || *
/* yog txhawm rau txheeb xyuas tus password
//# yog rov pib dua tus password
/////////////////////////////////////////////////////////////////
#suav nrog
//https://www.arduino.cc/playground/uploads/Code/Password.zip #include //https://www.arduino.cc/playground/uploads/Code/Keypad.zip
Lo lus zais = Lo lus zais ("1234");
Servo tswj; // tsim cov khoom siv servo los tswj lub servo
#define servoPin 10
const byte ROWS = 4; // Plaub kab
const byte COLS = 4; // kab ntawv // Txhais cov Keymap char [ROWS] [COLS] = {{'1', '2', '3', 'A'}, {'4', '5', '6', ' B '}, {' 7 ',' 8 ',' 9 ',' C '}, {'*',' 0 ','#',' D '}};
byte rowPins [ROWS] = {9, 8, 7, 6}; // Txuas cov keyboard ROW0, ROW1, ROW2 thiab ROW3 rau cov pin Arduino.
byte colPins [COLS] = {5, 4, 3, 2,}; // Txuas cov keyboard COL0, COL1 thiab COL2 rau cov Pin Arduino.
// Tsim cov Keypad
Keypad keypad = Keypad (uaKeymap (tuav), rowPins, colPins, ROWS, COLS);
void teeb tsa () {
myservo.attach (servoPin); // txuas cov servo ntawm tus pin 9 rau cov khoom siv servo
Serial.begin (9600);
keypad.addEventListener (keypadEvent); // ntxiv tus neeg mloog qhov xwm txheej rau cov keyboard no
myservo.write (0);
}
void voj () {
keypad.getKey ();
}
// saib xyuas qee qhov xwm txheej tshwj xeeb
void keypadEvent (KeypadEvent eKey) {hloov (keypad.getState ()) {case PRESSED: hloov (eKey) {case '*': checkPassword (); tawg; default: password.append (eKey); }}}
void checkPassword () {
yog (password.evaluate () == tseeb) {Serial.println ("Ua tiav"); // Ntxiv cov cai los ua haujlwm yog tias nws ua haujlwm
myservo.write (180);
ncua (3000);
myservo.write (0);
password.reset ();
} lwm tus yog (password.evaluate () == tsis tseeb) {
Serial.println ("Tsis yog");
myservo.write (0);
// ntxiv cov cai los khiav yog tias nws tsis ua haujlwm
}
}
Kauj Ruam 3: Txhua Qhov No Puas Yog?
Cov cai saum toj no (thawj tus) yuav muab lub teeb liab rau Servo kom "cheb" lossis tsuas yog mus ntawm 0 txog 180 degrees. Lossis tsuas yog ua kom tiav ib nrab ntawm lub voj voog ntawm kev sab laug mus rau sab xis lossis sab xis mus rau sab laug. Yog tias koj xav paub ntau ntxiv ntawm tus lej kuv tuaj yeem qhia koj. Tsuas yog thov nug. Tsis muaj kev phom sij ua tiav, tsuas yog lo lus nug me me yooj yim. Los, koj ua tau! Xijpeem, txoj cai nyob hauv nruab nrab ntsuas txhua lub pob ntawm cov keyboard. Thiab qhov kawg ntawm txoj cai tsuas yog "xauv" nrog lub servo thaum koj ntaus tus lej "1234" rau hauv, koj kwv yees nws, cov keyboard.
Kauj ruam 4: Troubleshooting
Q: Kuv lub keyboard tsis ua haujlwm.
A: Nco ntsoov thawj tus pin yog 9 yog li nqis los ntawm qhov ntawd. Tsis tas li nco ntsoov txuas lub arduino mus rau USB chaw nres nkoj ntawm lub computer thiab program Arduino.
Q: Servo tsis ua haujlwm.
A: Nco ntsoov tias tus pin servo yog tus pin 10 thiab koj xav tau ib qho hauv av, yog tias koj txuas ncaj qha los ntawm Arduino, nco ntsoov tias tus txiv kab ntxwv tus pin (ntawm micro servo) yog tus pin 10, tus pin liab yog 5V, thiab tus pin xim av yog GND tus pin.
Q: Arduino tsis ua haujlwm:
A: Koj puas tau txuas nws? Qhov ntawd zoo li yog teeb meem ntawm tus kheej
Kauj Ruam 5: Yog tias Koj Muaj Lus Nug, Ua Ntej Xav Nug Hauv Kab Lus Tawm thiab Nco ntsoov Sau Npe
Bye, ua tsaug rau kev saib kuv cov lus qhia. Nws tau lom zem.
Pom zoo:
Niaj hnub nimno thiab Tshiab thiab Yooj Yim Piv Txwv Ntawm Cov Xauv Nrog Arduino Matrix Keypad 4x4: 3 Cov Kauj Ruam
Niaj hnub nimno thiab Tshiab thiab Yooj Yim Piv Txwv Ntawm Lub Xauv Nrog Arduino Matrix Keypad 4x4: Lwm qhov piv txwv ntawm kev siv lub LCD keypad matrix 4x4 nrog I2C Circuit Court
Lub Xauv Lub Tsheb Tsis Xauv: 6 Kauj Ruam
Qhov Ruaj Ntseg Hauv Lub Tsheb Xauv: Ib yam uas ntau tus neeg tsis paub yog tias nws yooj yim dua tuaj tos cov tsheb kauj vab dua li nws zoo li. Tias yog vim li cas peb pab pawg tau thov peb tsim qauv rau RFID qhib lub tsheb kauj vab U-xauv. Hloov chaw ntawm kev siv lub tshuab ntsuas phoo qub qub, cov neeg siv tau yooj yim tuav
VBA Code kom Xauv Lub Xauv Excel Ntawv: 4 Cov Kauj Ruam
VBA Code txhawm rau Xauv Daim Ntawv Xauv Excel: Yog tias koj puas tau hnov qab lo lus zais rau ib qho ntawm koj daim ntawv ua haujlwm zoo koj paub tias yuav ua rau muaj kev ntxhov siab li cas. Cov cai siv hauv cov lus qhia no yog ib qho uas yooj yim tshaj plaws uas kuv tau pom. Nws yuav tsim cov lej siv tau uas yuav qhib koj daim ntawv tiv thaiv. Kuv
Windows PC Xauv/Xauv Siv RFID: 7 Kauj Ruam (nrog Duab)
Windows PC Xauv/Xauv Siv RFID.: Nyob zoo! Koj tau nkees nkees npaum li cas los sau tus lej nkag los qhib koj lub PC/laptop txhua lub sijhawm nws tau xauv? Kuv tau siv los kaw nws ntau zaus, txhua hnub, thiab tsis muaj dab tsi cuam tshuam ntau dua li ntaus tus password/tus lej hla thiab ntau dua
Cryptap: Lub Qhov Rooj Xauv Qhov Rooj Xauv: 5 Kauj Ruam
Cryptap: Rhythm-based Door Lock: Kev tshoov siab los ntawm ntau lub qhov rooj qhib qhov rooj kuv tau pom ntawm hackaday.com, Kuv txiav txim siab los tsim ib qho ntawm kuv tus kheej. Qhov no muaj ob-khawm interface; ib qho kom pib thiab xaus qhov kev xa tus password, thiab ib qho ua tau tiag tiag hauv lub suab sib dhos uas yog koj tus passwor