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