Skip to content

Instantly share code, notes, and snippets.

@deroses

deroses/MQ136 Secret

Created November 5, 2014 23:24
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 deroses/498ff51b5e0adc6b48f3 to your computer and use it in GitHub Desktop.
Save deroses/498ff51b5e0adc6b48f3 to your computer and use it in GitHub Desktop.
simple example of code to connect MQ line of sensors with Android phone
#include <MeetAndroid.h>
// http://www.amarino-toolkit.net/index.php/download.html
MeetAndroid meetAndroid;
int sensorValue;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
meetAndroid.receive(); // you need to keep this in your loop() to receive events
sensorValue = analogRead(0); // read input pin [alalog 0]
meetAndroid.send((sensorValue, DEC)); // send result to Android
delay(1000); // add delay
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment