Class UltrasonicRangefinder - GSTCH/SketchMadeEASY GitHub Wiki
Topic | Specification |
---|---|
Description | A common Ultrasonic Rangefinders such as the HY-SRF05. Value (distance) in cm. Sketch Made EASY automatically scales the input to the actuators. The value range of the input is required for this. This range is given for most inputs. When measuring distances, these vary depending on the use. Therefore, the distance range can be defined by MinValue and MaxValue. |
Constructor |
UltrasonicRangefinder(int EchoPin, int TriggerPin, int MeasureInterval) UltrasonicRangefinder(int EchoPin, int TriggerPin, int MeasureInterval, int MinValue, int MaxValue) Parameter EchoPin: Digital (Input) PinTriggerPin: Digital (Output) PinMeasureInterval: Optional with default = 500 Milliseconds. Values less than 100 Milliseocond are capped to 100.MinValue: When not set, value is 0.MaxValue : When not set, value is 200cm. |
Range | Parameter MinValue…MaxValue (default 0 …200) |
Samples | UltrasonicRangefinder sensor = new UltrasonicRangefinder(6, 7, 800); UltrasonicRangefinder sensor = new UltrasonicRangefinder(6, 7, 800, 50, 100); |
Examples | 19 ‐ Buzzer tone in relation to distance |