arduino hc-sr04

Thread Starter

mpbenoit55

Joined May 7, 2014
6
it seems that no matter what I do, my arduino will not compile the hc-sro4 without error. I am using the NewPing library.
#include <NewPing.h>
#define TRIGGER_PIN 12;
#define ECHO_PIN 11;
#define MAX_DISTANCE 200;

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

void setup() {
Serial.begin(115200);
}

void loop() {
delay(50);
unsigned int uS = sonar.ping();
Serial.print("Ping: ");
Serial.print(uS / US_ROUNDTRIP_CM);
Serial.println("cm");
}
 

djsfantasi

Joined Apr 11, 2010
9,237
And the errors are?

The IDE has a button to copy the error messages to the clipboard. I think they'd be useful for us to help...
 
Top