O'Reilly logo

Netduino Home Automation Projects by Matt Cavanagh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Netduino code

Remember using the .NET Micro Framework Toolbox subframework? Well, that library actually has some code to help with using a keypad like this. However, it is important too that we go over some more complicated code occasionally, even if it feels a bit like reinventing the wheel. An advantage of doing it yourself is that you will know what is going on, as opposed to attempting to read someone else's code which may appear like a long-lost Klingon dialect:

  1. Create a new Netduino Plus 2 Application.
  2. The whole lock mechanism is pretty useless if we can't move the servo, so add the servo library as in Chapter 6, You've Got Mail, and Here's a Flag to Prove It.
  3. In Program.cs we need to declare a few class variables. Just above the Main

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required