Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18089

Re: RECEIVE SMS

$
0
0

Well, you will have to use both Serial AND Serial1.

 

Serial connects the code to your computer and Serial1 connects to your GPRS shield.

 

What shield are you using? You won't be able to use serial communication on the Galileo board on digital I/O 7 and I/O 8. These pins are driven via the I/O expander and it's too slow for bit banging serial communications at a usable speed.

 

If you can configure the shield (maybe via jumpers or similar) to use digital pin 0 and pin 1, that is what you should do.

 

To hook up the two serial ports so that the code does a pass through, you can use one of the examples in the Arduino IDE (Examples -> 04.Communications -> MultiSerialMega)

 

I have pasted in the code below:

 

/*

  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

modified 20 May 2012

by Tom Igoe & Jed Roach

 

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 = Serial1.read();

    Serial.write(inByte);

  }

 

  // read from port 0, send to port 1:

  if (Serial.available()) {

    int inByte = Serial.read();

    Serial1.write(inByte);

  }

}

 

I hope this helps you out.

 

/Thomas


Viewing all articles
Browse latest Browse all 18089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>