So I've got this project built off of a MindsI robotics kit. At its bare minimum, I have one servo motor connected into slot 11 of the sensor shield, and one Parallax Ping sensor connected into slot 7.
With this code,
#include <MINDSi.h>
#include <Servo.h>
Servo drive, steer;
void setup()
{
Serial.begin(9600);
//steer.attach(11);
//steer.write(90);
delay(2000);
}
void loop()
{
int ping = getPing(7);
Serial.println(ping);
}
The ping sensor funtions perfectly, and outputs roughly accurate distances. As soon as I uncomment one line,
steer.attach(11);
the ping sensor ceases to work, and outputs a LOT of zeroes, followed by one or two seemingly arbitrary distances every minute.
It is not this exact sensor shield, but it is very similar in structure, just mildly different layout.
http://www.amazon.com/SainSmart-Sensor-Digital-Arduino-Duemilanove/dp/B006TQ314G/ref=sr_1_1?ie=UTF8&qid=1340828476&sr=8-1&keywords=arduino+sensor+shieldDoes anyone have a clue why this should happen?