Main Site Documentation

Seeedstudio Grove Moisture Sensor


#1

Hello,
I have the Seeedstudio Grove Moisture Sensor and I want to know how to use it with the fez connect. I have the vcc,gnd and 2 signal wires connect on the fez connect. It seems that the code for it is in java, how will I get it to work? I am using the fez panda with the fez connect.
Thanks, :slight_smile:


int sensorPin = A0;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor
 
void setup() {
  // declare the ledPin as an OUTPUT:
   Serial.begin(9600);  
}
 
void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);    
  delay(1000);          
  Serial.print("sensor = " );                       
  Serial.println(sensorValue);                   
}

http://www.seeedstudio.com/wiki/Grove_-_Moisture_Sensor


#2

http://wiki.tinyclr.com/index.php?title=Analog_Inputs


#3

Thanks,
I will read it then keep you updated.


#4

That’s not java. It’s a short Arduino sketch.


int sensorPin = A0;  

looks illegal, unless there is a #define not included here.

@ noob123 - We’re here to help, but we are not going to write the code for you. Before posting something like this, do some research, try some code, work through bugs, and then ask specific questions with supporting information.


#5

Well it`s Java, look at the link.


#6

Whatever you say, dude…


#7

Thanks,
I just saw your edited post.


#8

One last question. this sensor has a wired 4 connection thing. If I use http://www.dfrobot.com/index.php?route=product/product&path=36_64&product_id=599 can I use a JST3AA wire? I asked this because I also have the DHT11 (made from DFrobot) and I have to use 2 signal pins.
Thanks,
Sorry for being an idiot asking to many questions :-[