The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Interfacing a 4X3 door key pad and sensor code with netduino
Am a beginner, and i have just bought netduino for my project, i would like to interface it with a door key pad to control the arming and disarming the buzzer and at the same time interface it with sensors to detect motion through the windows. but i don't know how to start with that.
I finished the netduino beginner project, now am looking forward to my project.
Is it possible to have a driver class from you for the keypad, i need to look at your sample, Thank you so much for replying, iam happy bce you responsed when i need your help. I have been having fun with my netduino by playing some tunes using the buzzer
I have used the keypad driver and it works , but only key 4 and key 8 are right according to the output, i have tried changing the pins to give out the right keys according to datasheet of my keypad but it has failed to the other numbers right
The part number of my keypad is 88AB2-143.
It has the same key and pin assignment as yours.
Please help me with this so that i can finish it and the i see how to send commands out
public class Program
{
static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
static string[] password = { "1", "2", "3" };
static string[] entered_password = new string[3];
static int index = 0;
public static void Main()
{
//these are my key assigment
// Column pins .The keyPad exists out of 3 colums
Cpu.Pin[] ColPins = { Pins.GPIO_PIN_D5,Pins.GPIO_PIN_D6, Pins.GPIO_PIN_D7 };
//Row pins. The keypad exists out of 4 rows.
Cpu.Pin[] RowPins = { Pins.GPIO_PIN_D1,Pins.GPIO_PIN_D2,Pins.GPIO_PIN_D3,Pins.GPIO_PIN_D4 };
//initializes the new keypad
MatrixKeyPad kb = new MatrixKeyPad(RowPins, ColPins);
// Bind both events
kb.OnKeyDown += new NativeEventHandler(kb_onKeyDown);
//OutPins.OnInterrupt += new NativeEventHandler(output_OnInterrupt);
Thread.Sleep(Timeout.Infinite);
}
//Triggered when a key is pressed
//The key code
//Date and time of the event
static void kb_onKeyDown(uint keyCode, uint Unsed, DateTime Time)
{ // initializing a vailable;
string key = keyCode.ToString();
int j = 0;
//check at increment 2
if (index <=2)
{
// assign ke+y into an array
Debug.Print(key+ " : " + index);
entered_password[index] = key;
index++;
if (index >2)
{
if ( entered_password[0] == password[0] && entered_password[1] == password[1] && entered_password[2] == password[2])
{
while (j != 3)
{
led.Write(true);
Thread.Sleep(500);
led.Write(false);
Thread.Sleep(500);
j++;
}
}
}
}
}
}
sorry for taking long to respond but that worked for me, right now i have been trying to connect the infrared sensors but i can detect transmission from a tv remote, and the led transmitter seems not to work, i want to pick data if the connection of the infra red sensors to be used, it seems not working, i connected my output to the led just in case there's something detected.
Hi Stefan, i hope you saw my code, it was successful 4 me, but now am working on infra red sensors, i need help with the circuit connection so that i can pick out and use it in code, so far i first wanted to use a led to blink if there was any abstraction, then i can interface it to the netduino, for any suggestion i will be very grateful thinks.