Étape 2: Code
N’oubliez pas d’obtenir la bibliothèque FPS !
Le code est de copier collé ci-dessous, le fichier .ino est également joint :
/*
Bibliothèque FPS créé par Josh Hawley, 23 juillet 2013 homologués pour un usage non commercial, doit inclure ce message de licence fondamentalement, n’hésitez pas à tailler loin à elle, mais juste me donner crédit pour mon travail =) TLDR ; Droit de Wil Wheaton * /
#include « FPS_GT511C3.h » #include « SoftwareSerial.h »
FPS_GT511C3 fps (4, 5) ;
touch int = 0 ; capPin int = 9 ; drapeau de l’int = 0 ;
void setup() {Serial.begin(9600); / / fps. UseSerialDebug = true ; ainsi vous pouvez voir les messages dans le débogage serial écran fps. Open() ; pinMode (sortie 10,) ; digitalWrite (10, faible) ; pinMode (capPin, INPUT_PULLUP) ; }
void loop() {touch = digitalRead(capPin); / / Serial.println(touch) ; if ((touch == 0) & & drapeau == 0) {digitalWrite (10, HIGH); fps. SetLED(true) ; Si (i/s. IsPressFinger()) {fps. CaptureFinger(false) ; int id = fps. Identify1_N() ; Si (id < 200) {//Don't soins qui fingerprint matches, juste tant qu’il y a un match de football digitalWrite (10, LOW); fps. SetLED(false) ; drapeau = 1 ; {}} else {fps. SetLED(false) ; digitalWrite (10, faible) ; {Si ((touch == 1) & & drapeau == 1) {//Reset le drapeau après le marteau a été levé pour revenir au drapeau comportement normal = 0;}}