simple example of code to connect MQ line of sensors with Android phone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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