Skip to content

Instantly share code, notes, and snippets.

@deroses deroses/MQ136 Secret
Created Nov 5, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.