problem with code for PIR activating 4 servos in series

Hello,

This is my 2nd arduino project. It is for an art installation where a PIR sensor activates 4 servo motors in series, one after another, going 180 degrees and back. I want the servos to stop and back at original place only when the motion has stopped (there will be fabric lines attached to wheels, that's attached to servos, which i hope creates a wave-kind of motion)

I have included the PIR code from the examples I found online, but there is a problem when I tried compiling it. I don't understand the PIR code part completely so I am unable to fix this.

It say 'class Serial_' has no member named 'printIn'

#include <Servo.h>

Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;

// the time we give the sensor to calibrate (10-60 secs)
int calibrationTime = 30;
long unsigned int lowIn; //the time when sensor outputs a low impulse
long unsigned int pause = 3000; // the amount of millisecounds the sensor has to be low to assume all motion has stopped

boolean lockLow = true;
boolean takeLowTime;

int PIR = 3; // digital pin 3 has a PIR attached to it. Give it a name:
int angle = 0; //servo position in degrees

////////////
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600); //initialize serial communication at 9600 bits per second:

pinMode(PIR, INPUT);
servo1.attach(5); // servo machine 1 on pin 5
servo2.attach(6); // servo machine 2 on pin 6
servo3.attach(7); // servo machine 3 on pin 7
servo4.attach(8); // servo machine 4 on pin 8
digitalWrite(PIR, LOW);  // PIR starts with low

Serial.print("calibrating sensor ");
 for(int i = 0; i < calibrationTime; i++) {
  Serial.print(".");
  delay(1000);
 }
 Serial.printIn(" done");
 Serial.printIn("SENSOR ACTIVE");
 delay (30);
}

void loop() {
  // put your main code here, to run repeatedly:

if(digitalRead(PIR)==HIGH) { //if PIR output is HIGH, turn servo on

//scan from 0 to 180 degrees
for(angle = 0; angle < 180; angle++)
{
  servo1.write(angle);
  delay(100);
  servo2.write(angle);
  delay(100);
  servo3.write(angle);
  delay(100);
  servo4.write(angle);
  delay(100);
}
//now scan back from 180 to 0 degrees
for(angle = 180; angle > 0; angle-- )
{
  servo1.write(angle);
  delay(100);
  servo2.write(angle);
  delay(100);
  servo3.write(angle);
  delay(100);
  servo4.write(angle);
  delay(100);
}
}
if(lockLow){ //make sure we wait for a transition to LOW before further output is made
  lockLow = false;
  Serial.printIn("---");
  Serial.print("motion detected at");
  Serial.print(millis()/1000);
  Serial.printIn ("sec");
  delay(50);
}
takeLowTIme = true;


if(digitalRead(PIR)==LOW{
  if(takeLowTIme){
    lowIn = millis(); //save the time of the transition from HIGH to LOW
    takeLowTime = false; // make sure this only done at the stat of a LOW phase
  }
  // if PIR is low for more than a given pause, we assume motion has stopped
  if(!lockLow && millis() - lowIn > pause){ //make sure this block of code is executed again after a new motion is detected
    lockLow = true;
    Serial.print("motion ended at"); // output
    Serial.print((millis() - pause)/1000);
    Serial.printIn("sec");
    delay(50);
  }
}

}

Many thanks in advance for every help and your time :slight_smile:

fixed it (sheepish look )

i had written .printIn , it was supposed to be .println

sorry to bother ya all .