Created
January 14, 2014 03:04
-
-
Save treeherder/8412333 to your computer and use it in GitHub Desktop.
for darren's door
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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