I am using the adafruit motor/servo shield (1.2). Last night I soldered some stacking headers onto the board for the analog breakout pins. When I tried to read from a simple ground moisture sensore, the values were going up and down for no reason. Here is a youtube video of the output I got whilst running the following sketch:
Code: Select all
int pinLightLeft = A0;
int leftLightValue = 0;
// the setup routine runs once when you press reset:
void setup() {
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
leftLightValue = analogRead(pinLightLeft);
Serial.println(leftLightValue);
delay(200);
}
When I plug the sensor directly into the Arduino, after removing the shield, the values are how they should be. My guess would be there is some noise in the shield? There are two DC motors attached to the shield. Hope someone can help me in solving this problem!
Thanks,
Gerome