Adding temperature sensor to SensorGraph.

12 views
Skip to first unread message

mario jo

unread,
May 20, 2015, 3:32:14 AM5/20/15
to amarino...@googlegroups.com
Hello, I have played with SensorGraph and it working perfectly. Currently, I want to add temperature sensor to this project and display only the temperature value on android. Can anybody help me? I only know arduino but not eclipse. Here is the arduino code that I think I should add.

#include <MeetAndroid.h>

MeetAndroid meetAndroid;
int sensor = A5;
int temp = A1;
int vcc = A0;
int gnd = A2;

void setup() 
{
 
  Serial.begin(9600);
 
  pinMode(sensor, INPUT);
  pinMode(temp, INPUT);
  digitalWrite(vcc, HIGH);
  digitalWrite(gnd, LOW);
}

void loop()
{
  sensor2=analogRead(sensor);
  temp2=analogRead(temp);
  meetAndroid.receive(); // keep this in loop() to receive events
 
  // read input pin and send result to Android
  meetAndroid.send(sensor2);
  meetAndroid.send(temp2);
 
  // add a little delay otherwise the phone is pretty busy
  delay(10);
}


Thanks.
Reply all
Reply to author
Forward
0 new messages