so I have a lot of code, and won't bother posting all of it here....I'm running Arduino 17 (the latest AFAIK) and I'm getting the error "'pulseTime1' was not declared in this scope" when I run it. I've seen this problem when trying to call a function with an older form of IDE, but this is weird. Here's the includes at the beginning
#include <SoftwareSerial.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
and here's the function I'm having problems with. Help?
void run_sonar(){
for(i=1;i<4;i++)
pulseTime[i] = 0;
// send the sensor a 10microsecond pulse:
digitalWrite(INIT_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(INIT_PIN, LOW);
// wait for the pulse to return. The pulse
// goes from low to HIGH to low, so we specify
// that we want a HIGH-going pulse below:
pulseTime1 = pulseIn(ECHO1_PIN, HIGH,30000); //times out after 30us.
pulseTime2 = pulseIn(ECHO2_PIN, HIGH,30000);
pulseTime3 = pulseIn(ECHO3_PIN, HIGH,30000);
// the distance in inches from the object
// is uS/148
objDistance1 = pulseTime1/148;
objDistance2 = pulseTime2/148;
objDistance3 = pulseTime3/148;
}
error: 'pulseTime1' was not declared in this scope