Created
June 22, 2016 04:02
-
-
Save yeffrimic/c721fb90ec5546955585050791258fb2 to your computer and use it in GitHub Desktop.
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
// this sketch is used for testing LoNet with Arduino | |
// Connect VIO to +5V | |
// Connect GND to Ground | |
// Connect RX (data into SIM808) to Digital 11 | |
// Connect TX (data out from SIM808) to Digital 10 | |
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(2, 3); // RX, TX | |
void setup() | |
{ | |
// Open serial communications and wait for port to open: | |
Serial.begin(9600); | |
mySerial.begin(9600); | |
} | |
void loop() // run over and over | |
{ | |
if (mySerial.available()) | |
Serial.write(mySerial.read()); | |
if (Serial.available()) | |
{ | |
while(Serial.available()) | |
{ | |
mySerial.write(Serial.read()); | |
} | |
mySerial.println(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment