MultiSerialMega - by Tom Igoe This example code is in the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Mega multple serial test Receives from the main serial port, sends to the others. Receives from serial port 1, sends to the main serial (Serial 0). This example works only on the Arduino Mega The circuit: * Any serial device attached to Serial port 1 * Serial monitor open on Serial port 0: created 30 Dec. 2008
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: by Tom Igoe This example code is in the public domain. */ void setup() { // initialize both serial ports: Serial.begin(9600); Serial1.begin(9600); } void loop() { // read from port 1, send to port 0: if (Serial1.available()) { int inByte =; Serial.print(inByte, BYTE); } }...
View Full Document

This note was uploaded on 01/31/2011 for the course CS 302 taught by Professor J.parker during the Spring '08 term at University of Texas.

Ask a homework question - tutors are online