trying to get a pololu motordriver to work with my ping i keep getting a expected unqualified-id before "if"
const int pingPin = 8;
void setup() {
Serial.begin(9600);
}
void loop()
{
long duration, inches;
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);
pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);
inches = microsecondsToInches(duration);
Serial.print(inches);
Serial.print("in, ");
Serial.println();
delay(100);
}
long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}
if ( inches < 70) {
//left motor
unsigned char buff3[6];
buff3[0]=0x80;
buff3[1]=0x00;
buff3[2]=0x00;
buff3[3]=0x35;
for(int i=0; i<4; i++) {Serial.print(buff3*, BYTE);}*
//right motor
unsigned char buff4[6];
buff4[0]=0x80;
buff4[1]=0x00;
buff4[2]=0x02;
buff4[3]=0x35;
for(int i=0; i<4; i++) {Serial.print(buff4*, BYTE);}*
}
}