Skip to content

Instantly share code, notes, and snippets.

@treeherder
Created January 14, 2014 03:04
Show Gist options
  • Save treeherder/8412333 to your computer and use it in GitHub Desktop.
Save treeherder/8412333 to your computer and use it in GitHub Desktop.
for darren's door
#include <SoftwareSerial.h>
const int rxpin = 2; // pin used to receive
const int txpin = 3; // pin used to send to
SoftwareSerial keypad(rxpin, txpin); // new serial port on given pins
void setup()
{
Serial.begin(9600);
keypad.begin(2400); // initialize the software serial port
Serial.println("Serial ready");
keypad.println("keypad ready");
}
void loop()
{
if (keypad.available())
{
char c = (char)keypad.read();
Serial.write(c);
}
if (Serial.available())
{
char c = (char)Serial.read();
keypad.write(c);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment