I am using Arduino UNo with GPS data going into pin 3
and a servo connected to pin 9 - nothing else.
I am using 3 libraries
SoftwareSerial
Servo
TinyGPS
but my problem seems to be between SoftwareSerial and Servo
If I install the demo Servo code everything works fine.
I have simplified my code as much as pos - to show the problem
(No code at all in the loop, and no TinyGPS library)
If i include the line (see code below)
ss.begin(9600);
then i get random erratic movement from the servo on pin 9 every second - even though the
myservo.write(pos); is commented out.
(I need "ss.begin(9600)" as I am using TinyGPS.)
If I comment out this code then I can get the servo to behave (but I cant then use TinyGPS which needs this line.)
ANy ideas anyone - I am completely stuck
SoftwareSerial seems to be sending something down pin 9??
ANdrew
#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial ss(3, 4);
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
//next line cases the problems
//ss.begin(9600);
}
void loop()
{
//pos = random(5);
//myservo.write(pos);
//delay(1200);
}