Skip to content

Commit

Permalink
Clean examples and SRF08 default to 6m
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb committed Jun 21, 2014
1 parent da8a3a2 commit cbe46f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions examples/SRF02/SRF02.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#define LEFT_02_ADDRESS (0xF2 >> 1)
#define RIGHT_02_ADDRESS (0xE0 >> 1)
#define MAIN_08_ADDRESS (0xF8 >> 1)
SonarSRF02 LeftSonar;
SonarSRF02 RightSonar;

Expand Down Expand Up @@ -44,7 +43,6 @@ void loop() {
void distance(String reference, int sensorReading) {
Serial.print("Distance from " + reference + ": ");
Serial.print(sensorReading);
Serial.print(" ");
Serial.print(unit);
Serial.println();
}
Expand Down
7 changes: 2 additions & 5 deletions examples/SRF08/SRF08.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@
#include <Wire.h>
#include <SonarSRF08.h>

#define LEFT_02_ADDRESS (0xF2 >> 1)
#define RIGHT_02_ADDRESS (0xE0 >> 1)
#define MAIN_08_ADDRESS (0xF8 >> 1)
SonarSRF08 MainSonar;

// Setup Analogue Gain
// http://www.robot-electronics.co.uk/htm/srf08tech.html section "Analogue Gain"
#define GAIN_REGISTER 0x00
#define GAIN_REGISTER 0x09
// Setup Range Location
// http://www.robot-electronics.co.uk/htm/srf08tech.html section "Changing the Range"
#define LOCATION_REGISTER 0x00
#define LOCATION_REGISTER 0x8C

char unit = 'c'; // 'i' for inches, 'c' for centimeters, 'm' for micro-seconds

Expand All @@ -43,7 +41,6 @@ void loop() {
void distance(String reference, int sensorReading) {
Serial.print("Distance from " + reference + ": ");
Serial.print(sensorReading);
Serial.print(" ");
Serial.println(unit);
}

Expand Down

0 comments on commit cbe46f0

Please sign in to comment.