SHARE
TWEET

Losenord_longd

a guest Dec 10th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char tecken;
  2. String losenord = "";
  3. int len;
  4.  
  5. void setup() {
  6.   Serial.begin(9600);
  7.   pinMode(8, OUTPUT);
  8.   pinMode(2, OUTPUT);
  9.   Serial.println("Ange lösenordet");
  10. }
  11.  
  12. void loop() {
  13.   if (Serial.available()){
  14.     tecken = Serial.read();
  15.     if (tecken != '#'){
  16.       losenord += tecken;
  17.     }
  18.     else{
  19.       len = losenord.length();
  20.       losenord = "";
  21.       if (len < 6){
  22.         digitalWrite(8, HIGH);
  23.         delay(1000);
  24.         digitalWrite(8, LOW);
  25.       }
  26.       else{
  27.         digitalWrite(2, HIGH);
  28.         delay(1000);
  29.         digitalWrite(2, LOW);
  30.       }
  31.     }
  32.   }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top