Interface class for the Max Botix ultrasonic range finder model 1210. It includes input methods for PWM, Analog, and Serial. A PwmIn class was created to allow the PWM input to be read. Now includes automatic range update via interrupts.

Dependencies:   mbed

Revision:
3:05183e50a923
Parent:
2:997b4057c879
Child:
4:a615b75d4126
--- a/MB1210.cpp	Mon Aug 23 07:11:10 2010 +0000
+++ b/MB1210.cpp	Thu Aug 26 18:25:19 2010 +0000
@@ -85,6 +85,15 @@
 }
     //hold pin high for at least 20 us to request a synchronous range reading
 
+void MB1210::DiscardSerialBuffer()
+{
+    while (SerialInput->readable())
+    {
+        SerialInput->getc();
+    }
+}
+    //read characters from the buffer until it is empty
+
 float MB1210::Read()
 {
     switch (OperatingMode)
@@ -127,7 +136,7 @@
     }
 }
     //OperatingMode switches to desired output method;
-    //once gathered, the result is scaled according to voltage, the speed of sound, and desired unit
+    //the result is scaled according to voltage, the speed of sound, and desired unit
 void MB1210::Read(char* Buffer)
 {
     if (SerialInput)