Arduino Workshop: A hands-on introduction with 65 projects by John Boxall

Arduino Workshop: A hands-on introduction with 65 projects by John Boxall

Author:John Boxall
Language: eng
Format: epub
Tags: TECHNOLOGY & ENGINEERING / Robotics
ISBN: 9781593275259
Publisher: No Starch Press
Published: 2013-05-02T16:00:00+00:00


switch(xx) { case 1: // do something as the value of xx is 1 break; // finish and move on with sketch case 2: // do something as the value of xx is 2 break; case 3: // do something as the value of xx is 3 break; default: // do something if xx is not 1, 2 or 3 // default is optional }

The optional default: section at the end of this code segment lets you choose to run some code when true comparisons no longer exist in the switch-case statement.

Project #33: Creating a Keypad-Controlled Lock

In this project, we’ll create the beginning part of a keypad-controlled lock. We’ll use the basic setup described in the sketch in Example 9-1, but we’ll also include a secret code that will need to be entered on the keypad. The Serial Monitor will tell the user who types a code into the keypad whether the code is correct or not.

The sketch will call different functions, depending on whether the sixdigit secret code is correct. The secret code is stored in the sketch but is not displayed to the user. To activate and deactivate the lock, the user must press * and then the secret number, followed by #.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.