zhaw_st16b_pes2_10 / Mbed 2 deprecated PES_Official-TestF

Dependencies:   Servo ServoArm mbed

Fork of PES_Official by zhaw_st16b_pes2_10

Embed: (wiki syntax)

« Back to documentation index

Ultraschall Class Reference

Ultraschall Class Reference

Ultraschall Class(es) More...

#include <Ultraschall.h>

Public Member Functions

 Ultraschall ()
 Create a Ultraschall object connected to the specified pin.
unsigned int get_dist_cm (void)
 Return the distance from obstacle in cm.
unsigned int get_pulse_us (void)
 Return the pulse duration equal to sonic waves travelling to obstacle and back to receiver.
void start (void)
 Generates the trigger pulse of 10us on the trigger PIN.

Detailed Description

Ultraschall Class(es)

Definition at line 9 of file Ultraschall.h.


Constructor & Destructor Documentation

Ultraschall (  )

Create a Ultraschall object connected to the specified pin.

Parameters:
pini/o pin to connect to

Member Function Documentation

unsigned int get_dist_cm ( void   )

Return the distance from obstacle in cm.

Parameters:
distancein cms and returns -1, in case of failure

Definition at line 46 of file Ultraschall.cpp.

unsigned int get_pulse_us ( void   )

Return the pulse duration equal to sonic waves travelling to obstacle and back to receiver.

Parameters:
pulseduration in microseconds.

Definition at line 50 of file Ultraschall.cpp.

void start ( void   )

Generates the trigger pulse of 10us on the trigger PIN.

Definition at line 22 of file Ultraschall.cpp.