Interface library for the Devantech SRF02/SRF08 ultrasonic i2c rangers. Depends on I2cRtosDriver lib!

Committer:
humlet
Date:
Sat Feb 23 19:43:49 2013 +0000
Revision:
1:32c4dd194228
Parent:
0:2686e857daf6
Kein Bock mehr;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
humlet 0:2686e857daf6 1 #ifndef SRF02_IF_H
humlet 0:2686e857daf6 2 #define SRF02_IF_H
humlet 0:2686e857daf6 3
humlet 0:2686e857daf6 4 #include "mbed.h"
humlet 0:2686e857daf6 5
humlet 0:2686e857daf6 6 class SRF02_IF
humlet 0:2686e857daf6 7 {
humlet 0:2686e857daf6 8 int m_adr;
humlet 0:2686e857daf6 9 I2C& m_i2c;
humlet 0:2686e857daf6 10
humlet 0:2686e857daf6 11 public:
humlet 0:2686e857daf6 12
humlet 0:2686e857daf6 13 static const int sonicSpeed = 343;
humlet 0:2686e857daf6 14
humlet 0:2686e857daf6 15 SRF02_IF(int adr, I2C& i2c);
humlet 0:2686e857daf6 16
humlet 0:2686e857daf6 17 int triggerRanging();
humlet 0:2686e857daf6 18 int triggerPing();
humlet 0:2686e857daf6 19 int triggerEchoMeasurement();
humlet 1:32c4dd194228 20 int readTransitTime_us(int* dbg);
humlet 0:2686e857daf6 21
humlet 0:2686e857daf6 22 void resetI2CAdress(int newAddress);
humlet 0:2686e857daf6 23 };
humlet 0:2686e857daf6 24 #endif