Tamaryn Thomson / SRF02

Fork of SRF02 by Craig Evans

Files at this revision

API Documentation at this revision

Comitter:
el14tt
Date:
Wed May 04 10:39:39 2016 +0000
Parent:
1:8e6587d88773
Commit message:
SRF02 library for ELEC2645 project

Changed in this revision

SRF02.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8e6587d88773 -r 548b60c4cc15 SRF02.cpp
--- a/SRF02.cpp	Sun Mar 08 14:21:40 2015 +0000
+++ b/SRF02.cpp	Wed May 04 10:39:39 2016 +0000
@@ -1,3 +1,5 @@
+
+
 /**
 @file SRF02.cpp
 
@@ -7,6 +9,9 @@
 #include "mbed.h"
 #include "SRF02.h"
 
+#define SOUND_S (float)340.29
+#define SOUND_US (double)340.29/1000000
+
 SRF02::SRF02(PinName sdaPin, PinName sclPin)
 {
     i2c = new I2C(sdaPin,sclPin); // create new I2C instance and initialise
@@ -44,6 +49,9 @@
     return (data[0] << 8) | data[1];
 }
 
+
+    
+
 void SRF02::error()
 {
     while(1) {