Skip to content

Instantly share code, notes, and snippets.

@rburnett3
Created October 15, 2019 15:14
Show Gist options
  • Save rburnett3/86044b1640208a7f4abf13240e2cb25d to your computer and use it in GitHub Desktop.
Save rburnett3/86044b1640208a7f4abf13240e2cb25d to your computer and use it in GitHub Desktop.
MB7389 analog voltage
print_data();
delay(1000);
}/* Arduino example code for MaxBotix MB7389 HRXL-MaxSonar-WR weather resistant ultrasonic distance sensor: analog voltage output. More info: www.makerguides.com */
#define sensorPin A0
int distance = 0;
void setup() {
Serial.begin(9600);
}
void read_sensor() {
distance = analogRead(sensorPin) * 5;
}
void print_data() {
Serial.print("distance = ");
Serial.print(distance);
Serial.println(" mm");
}
void loop() {
read_sensor();
@josealvescarvalho
Copy link

HI this sensor working normally? Or have a variable meansuring? I'm using one but have a lof of disturb and change de value, but the object keep in same distance, I'm looking for other type of sensor for can try end my project, can you help me? Do you recomend this sensor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment