Cov txheej txheem:

PassPen (Tus Thawj Tswj Password Arduino): 4 Cov Kauj Ruam
PassPen (Tus Thawj Tswj Password Arduino): 4 Cov Kauj Ruam

Video: PassPen (Tus Thawj Tswj Password Arduino): 4 Cov Kauj Ruam

Video: PassPen (Tus Thawj Tswj Password Arduino): 4 Cov Kauj Ruam
Video: nyiag nkag koj tus hluas nkauj tus messenger ua koj twb g paub password 2024, Kaum ib hlis
Anonim
Image
Image
PassPen (Tus Thawj Tswj Password Arduino)
PassPen (Tus Thawj Tswj Password Arduino)

Nov yog kuv qhov haujlwm PassPen. me me arduino nano uas loggs kuv hauv lub khoos phis tawj ntawm tsev kawm ntawv.

Nws tau ua nrog PCB me me kuv tsim los nrog cov nyees khawm kom muaj tus pin tso cai xauv ua ntej luam tus lej nkag.

Kauj ruam 1: Tau txais Txoj Cai

Kho vajtse:

Arduino pro micro:

Micro Usb adapter (lossis cable yuav ua haujlwm).

Cov cai thiab PCB tsim tuaj yeem pom ntawm no:

rau Arduino pro micro siv PasscodeBoard.ino cov ntaub ntawv, thiab rau digispark board siv DigiSpark_passcode.ino cov ntaub ntawv.

Kauj ruam 2: Kev thaiv kab. (Yuav Ntxiv Ntxiv sai sai)

koj tuaj yeem xaiv cov tswv yim twg koj xav siv. kuv tus qauv siv cov tswv yim 2, 3 thiab 4.

Kauj Ruam 3: Hloov mus rau Qhov Koj Nyiam

Hloov tag nrho cov const int btnX, rau tus lej tus lej koj siv yog tias koj tsis siv tib yam li kuv nrog kuv lub rooj tsavxwm.

piv txwv:

const int btn1 = 10; // Qhov no teeb tsa khawm ib qho rau cov tswv yim digital 10.

Cov cai rau Arduino tau sau los tshuaj xyuas tus lej PIN_CODE.

yog li ntxiv tus pin xav tau ntawm {} - cov khoom sib dhos, nws tuaj yeem ze li ntev li koj xav tau, cov cai tau hloov pauv hauv qhov kev nkag siab.

piv txwv:

int PIN_CODE = {1, 2, 3, 3, 1};

tom qab ntawd ntxiv cov lej cim lossis lwm cov nyees khawm koj xav ntxig rau hauv rooj plaub "hloov (btn_number ())"

nyob rau hauv rooj plaub 1 yog cov khoom uas yuav luam tawm thaum khawm 1 raug nias, thiab ntxiv rau.

tsis tshem tawm qhov tawg; qhov kawg ntawm txhua rooj plaub. (Kuv hais qhov no hauv qhov xwm txheej koj tsis paub tias qhov kev hloov pauv ua haujlwm li cas.

piv txwv:

hloov (btn_number ()) {

rooj plaub 1: // Hom UserName ces tabbs mus rau tom ntej no, ntaus Password1 ces ntaus Enter.

Keyboard.println ("UserName"); Keyboard.press (KEY_TAB); Keyboard.release (KEY_TAB); Keyboard.println ("Password1"); Keyboard.press (KEY_RE END_TURN); Keyboard.release (KEY_RE END_TURN);

tawg;

rooj plaub 2: // Hom Password2

Keyboard.println ("Password2");

tawg;

rooj plaub 3: // Hom Password3, tom qab ntawd ntaus Enter.

Keyboard.println ("Password3"); Keyboard.press (KEY_RE END_TURN); Keyboard.release (KEY_RE END_TURN); tawg;

neej ntawd hais:

Keyboard.println ("Muaj qee yam tsis raug, thiab tsis muaj cov nyees khawm pom qhov twg."); tawg;}

Kauj Ruam 4: Sau rau Arduino

Sau rau Arduino
Sau rau Arduino
Sau rau Arduino
Sau rau Arduino
Sau rau Arduino
Sau rau Arduino

Kuv xav tias koj tau teeb tsa koj li Arduino IDE nrog cov pob tsim nyog rau Arduino Pro Micro.

Tab sis koj yuav tsum ntxiv Keyboard.h lub tsev qiv ntawv. qhib tus thawj tswj tsev qiv ntawv arduino, thiab tshawb nrhiav Keyboard, xaiv ib lub npe Keyboard, thiab nruab nws.

Kaw tus thawj tswj tsev qiv ntawv thaum koj ua tiav kev teeb tsa.

(xyuas kom koj lub rooj sib tham arduino txuas nrog thiab xaiv hauv cov cuab yeej ntawv qhia zaub mov.) Nyem rau khawm sau, thiab koj yuav tsum ua tiav!

Pom zoo: