Different uart for XBEE
This commit is contained in:
parent
baef89a9c4
commit
0d535aad56
|
@ -129,21 +129,25 @@ void setup()
|
|||
leftcountvalue = 0xAAA0;
|
||||
serialvalue = 0x0000;
|
||||
|
||||
// Communication w/PC for debug or other puroposes
|
||||
Serial.begin(9600);
|
||||
Serial.println("Arduino Serial Link");
|
||||
Serial.println("connected!");
|
||||
|
||||
// Communication w/XBEE
|
||||
Serial1.begin(9600);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (Serial.available())
|
||||
if (Serial1.available())
|
||||
{
|
||||
/* ** Buffer to store received char **
|
||||
* Data is an integer string terminated with newline '\n'
|
||||
* */
|
||||
static String inputString = "";
|
||||
|
||||
char digit = Serial.read(); // Read serial buffer
|
||||
char digit = Serial1.read(); // Read serial buffer
|
||||
// Check if string terminator
|
||||
if (digit == '\n')
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue