Question

anyone good on arduino? i have my keypad and lcd setup, but my code wont work?...

anyone good on arduino? i have my keypad and lcd setup, but my code wont work? anyone know how to write code for arduino? need to have it ask for password....the password is 1234567 and anything else will return incorrect. then i need seven different inputs to strart. inputs are 1234, 2345, 3456, 4567, 5678, 6789, 7890, and when all are entered correctly then the lcd will say "we are ready."

0 0
Add a comment Improve this question Transcribed image text
Answer #1

String readString;
int count = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
while (Serial.available()>0) {
readString = Serial.readString();
if(readString == "1234567") {
int i;
for(i = 1; i <= 6; i++) {
readString = Serial.readString();
if(i == 1) {
if(readString == "1234")
count++;
}
if(i == 2) {
if(readString == "2345")
count++;
}
if(i == 3) {
if(readString == "3456")
count++;
}
if(i == 4) {
if(readString == "4567")
count++;
}
if(i == 5) {
if(readString == "5678")
count++;
}
if(i == 6) {
if(readString == "6789")
count++;
}
if(i == 7) {
if(readString == "7890")
count++;
}
}
}
if(count == 7)
lcd.print("we are ready.");
}

Add a comment
Know the answer?
Add Answer to:
anyone good on arduino? i have my keypad and lcd setup, but my code wont work?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need a code an arduino code that works with RFID RC522, 4 x4 Matrix Keypad,...

    I need a code an arduino code that works with RFID RC522, 4 x4 Matrix Keypad, 2 LEDS and 1602 I2C LC Display I am building a project for school security, So the user must use their ID to access the system. When access is granted then student has the options to choose 1 or 2 ... (1) Green LED = Safe (2) Red LED = Danger .. I am also thinking about adding a camera to the system but...

  • I am having a little trouble with my Python3 code today, I am not sure what...

    I am having a little trouble with my Python3 code today, I am not sure what I am doing wrong. Here are the instructions: and here is my code: update: I have seen I did not close x in sumFile and I am still only getting a 2/10 on the grader. any help appreciated. Lab-8 For today's lab you going to write six functions. Each function will perform reading and/or write to a file Note: In zybooks much like on...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • Could anyone help add to my python code? I now need to calculate the mean and...

    Could anyone help add to my python code? I now need to calculate the mean and median. In this programming assignment you are to extend the program you wrote for Number Stats to determine the median and mode of the numbers read from the file. You are to create a program called numstat2.py that reads a series of integer numbers from a file and determines and displays the following: The name of the file. The sum of the numbers. The...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT