Skip to content

Instantly share code, notes, and snippets.

@hackolite
Last active January 6, 2016 15:49
Show Gist options
  • Save hackolite/f9337464e2d3e86c02fb to your computer and use it in GitHub Desktop.
Save hackolite/f9337464e2d3e86c02fb to your computer and use it in GitHub Desktop.
char NOMBRE[10] = "SENS01"; // le nom du module
char BPS = '4'; // 1=1200 , 2=2400, 3=4800, 4=9600, 5=19200, 6=38400, 7=57600, 8=115200
char PASS[10] = "1234"; // le mot de passe
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
delay(10000);
digitalWrite(13,LOW);
Serial.print("AT");
delay(1000);
Serial.print("AT+NAME");
Serial.print(NOMBRE);
delay(1000);
Serial.print("AT+BAUD");
Serial.print(BPS);
delay(1000);
Serial.print("AT+PIN");
Serial.print(PASS);
delay(1000);
}
void loop()
{
int mq3_value = analogRead(A0);
Serial.print(" {'luminosity': ");
Serial.print(mq3_value);
Serial.println("}");
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment