Skip to content

Instantly share code, notes, and snippets.

@tegila
Last active October 15, 2015 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tegila/9186f3a80d503376de2f to your computer and use it in GitHub Desktop.
Save tegila/9186f3a80d503376de2f to your computer and use it in GitHub Desktop.
SIM800L
/*
### 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