Dear Support,
RE Scarecroweyesmotor

I'm chagrined and beg your pardon for my making a typo; I knew the correct line should read: AF_DCMotor(2, MOTOR12_64KHZ); -- as you pointed out. Entering it carefully, I get the same error message, "unidentified ID before numerical constant", plus some others:
Scarecroweyesmotor:11: error: expected unqualified-id before numeric constant
Scarecroweyesmotor:11: error: expected `)' before numeric constant
Scarecroweyesmotor.cpp: In function 'void setup()':
Scarecroweyesmotor:15: error: 'motor' was not declared in this scope
Scarecroweyesmotor.cpp: In function 'void loop()':
Scarecroweyesmotor:30: error: 'motor' was not declared in this scope
I went to "Trouble Shooting" and there were lots of "unidentified ID" cases, all of which were answered by small corrections like ";" missing, etc. Going over my sketch several times didn't show me any errors that I could see.

Could you see something? (Sorry, I can't find the "Code" button that you prefer I use:
- Code: Select all
/*
* PIR move wings
* ledPin is the relay
*/
#include <AFMotor.h>
unsigned long time;
const int ledPin = 13; // choose the pin for the LED
const int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
AF_DCMotor(2, MOTOR12_64KHZ); // declaring as per 'AFMotor' sketch
void setup()
{
motor.setSpeed(200);
pinMode(ledPin, OUTPUT); // declare LED and Eye as output
pinMode(inputPin, INPUT); // declare sensor as input
}
void loop()
{
float time = millis();
pirState = digitalRead(inputPin); // read input value
if (pirState == HIGH) { // check if relay is on
digitalWrite(ledPin, HIGH); // turn eyes ON
motor.run(FORWARD); // move wings
delay(1000);
motor.run(RELEASE);
delay(500);
digitalWrite(ledPin, LOW); //turn signal off
} else {
if (pirState == HIGH) {
// We only want to print on the output change, not state
pirState = LOW;
}
}
}