Added serial IO to main loop for testing Cisco serial console work

This commit is contained in:
Mike C 2013-03-28 22:36:44 -04:00
parent 9c34d4ceaf
commit 7fcd7de8c4

View file

@ -50,22 +50,22 @@ char* modeToText[4] = {
// Known and supported line speeds // Known and supported line speeds
linespeedinfo linespeeds[6] = { linespeedinfo linespeeds[6] = {
{ {
"2400b", 2400 } "2400b", 2400 }
, ,
{ {
"9600b", 9600 } "9600b", 9600 }
, ,
{ {
"19.2k", 19200 } "19.2k", 19200 }
, ,
{ {
"38.4k", 38400 } "38.4k", 38400 }
, ,
{ {
"57.5k", 57600 } "57.5k", 57600 }
, ,
{ {
"115k", 115200 } "115k", 115200 }
}; };
// LCD // LCD
@ -113,9 +113,24 @@ void setup() {
// Setup defaults // Setup defaults
setDefaults(); setDefaults();
Serial.begin(9600);
Serial1.begin(9600);
} }
void loop() { void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.write(inByte);
}
xAxis=map(analogRead(xpin), 0, 1023, 0, 10); xAxis=map(analogRead(xpin), 0, 1023, 0, 10);
yAxis=map(analogRead(ypin), 0, 1023, 0, 10); yAxis=map(analogRead(ypin), 0, 1023, 0, 10);
@ -155,3 +170,5 @@ void loop() {
} }
} }