Lighting up an LED after entering a "password"
.
putting password in array of chars start. start array index variable set zero.
then, character received can compared character @ current position in array , if correct corresponding led turned on , index array incremented. once index equals 4 (see below) turn on fifth led. if wrong character received @ time turn off leds , set index 0 , start again.
the value of index 4 element array 0 3, hence test index reaching 4 indicating success. not try retrieve or test element 4 of array not exist.
then, character received can compared character @ current position in array , if correct corresponding led turned on , index array incremented. once index equals 4 (see below) turn on fifth led. if wrong character received @ time turn off leds , set index 0 , start again.
the value of index 4 element array 0 3, hence test index reaching 4 indicating success. not try retrieve or test element 4 of array not exist.
Arduino Forum > Using Arduino > Programming Questions > Lighting up an LED after entering a "password"
arduino
Comments
Post a Comment