#include <Smartcar.h>

SR04 front;
const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7

void setup() {
  Serial.begin(9600);
  front.attach(TRIGGER_PIN, ECHO_PIN); //trigger pin, echo pin
}

void loop() {
  Serial.println(front.getDistance());
  delay(100);
}


#include <Smartcar.h>

const int TRIGGER_PIN = 6; //D6
const int ECHO_PIN = 7; //D7
SR04 front(TRIGGER_PIN, ECHO_PIN, 10);


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

void loop() {
  Serial.println(front.getDistance());
  delay(100);
}


Update SR04 example to new 5.0 API
Update SR04 example to new 5.0 API
