Last active
October 15, 2015 01:34
-
-
Save tegila/9186f3a80d503376de2f to your computer and use it in GitHub Desktop.
SIM800L
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
/* | |
### Esquema de ligação ### | |
- Ligar o VCC do SIM800L a uma fonte +4V 2A estável | |
- Conectar o GND do SIM800L ao GND do Arduino e também ao GND da fonte. | |
> Todos alimentados agora podemos ligar a parte da comunicação serial | |
- Ligar o RX do SIM800L (ENTRADA) ao Digital 11 do Arduino | |
- Ligar o TX do SIM800L (SAIDA) ao Digital 10 do Arduino | |
## Utilização: | |
> Após instalados os | |
*/ | |
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial(10, 11); // 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