arduino hc-sr04

Discussion in 'Homework Help' started by mpbenoit55, Jul 19, 2015.

  1. mpbenoit55

    Thread Starter New Member

    May 7, 2014
    6
    0
    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");
    }
     
  2. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,812
    834
    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...
     
Loading...