#include #include #include #include #define ledPin 0 main(void){ if(wiringPiSetup() == -1){ // when initializing wiring failed, print message screen printf("setup wiringPi failed"); return 1; } pinMode(ledPin, OUTPUT); // set the pin mode char name[20]; while(1){ int x = 1; while(x!=0){ printf("Please enter the password: "); scanf("%s", name); if (strcmp(name, "lights") == 0){ digitalWrite(ledPin, HIGH); //LED on printf("Access Granted!"); } else{ printf("Access Denied, please wait 10 seconds before trying agian"); sleep(10); } } return 0; } }