Arduino state not declared in this scope -
i working on little project using arduino , below code:
#include <softwareserial.h> #include <adafruit_fingerprint.h> #include <keypad.h> const byte rows = 4; // 4 rows const byte cols = 3; // 3 columns // define keymap char keys[rows][cols] = { {'1','2','3'}, {'4','5','6'}, {'7','8','9'}, {'#','0','*'} }; // connect keypad row0, row1, row2 , row3 these arduino pins. byte rowpins[rows] = {2, 3, 4, 5}; // connect keypad col0, col1 , col2 these arduino pins. byte colpins[cols] = {6, 7, 8}; // create keypad keypad keypad = keypad( makekeymap(keys), rowpins, colpins, rows, cols ); #define ledpin 13 #define locked 2 #define password_ok 1 #define unlocked 0 //state variables; initialise locked state int lockstate = locked; int position = 0; void setup() { pinmode(ledpin,output); digitalwrite(ledpin, high); serial.begin(9600); //initialize state , communications setlockstate(locked); serial.begin(9600); } void loop() { char key = keypad.getkey(); if(key) // check valid key. { switch (key) { // case '*': // digitalwrite(ledpin, low); // break; // case '#': // digitalwrite(ledpin, high); // break; default: serial.print(key); } } }
it adafruit. however, when upload uno, keeps giving me error: 'setlockstate' not declared in scope.
can shed lite on this?
i think did not declare function setlockstate()
in code. don't know project details, looks want lock thing via keypad or fingerprint. can find great tutorial (including missing setlockstate()
function) biometric-security-box on website of adafruit.
arduino arduino-uno
No comments:
Post a Comment