This program is for an autonomous robot for the competition at the Hochschule Luzern. http://cruisingcrepe.wordpress.com/ We are one of the 32 teams. http://cruisingcrepe.wordpress.com/ The postition control is based on this Documentation: Control of Wheeled Mobile Robots: An Experimental Overview from Alessandro De Luca, Giuseppe Oriolo, Marilena Vendittelli. For more information see here: http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf

Dependencies:   mbed

Fork of autonomous Robot Android by Christian Burri

Embed: (wiki syntax)

« Back to documentation index

Hallsensor Class Reference

Hallsensor Class Reference

Interface to count the Hallsensor input from an EC-Motor. More...

#include <Hallsensor.h>

Public Member Functions

 Hallsensor (PinName hall1, PinName hall2, PinName hall3)
 Constructor of the class Hallsensor.
void reset (void)
 Reset the encoder.
int getPulses (void)
 Read the number of pulses recorded by the encoder.
int getRevolutions (void)
 Read the number of revolutions recorded by the encoder.

Detailed Description

Interface to count the Hallsensor input from an EC-Motor.

Author:
Christian Burri

Copyright (c) 2013 HSLU Pren Team #1 Cruising Crêpe All rights reserved.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition at line 24 of file Hallsensor.h.


Constructor & Destructor Documentation

Hallsensor ( PinName  hall1,
PinName  hall2,
PinName  hall3 
)

Constructor of the class Hallsensor.

Reads the current values on Hall1, Hall2 and Hall3 to determine the initial state. Attaches the encode function to the rise/fall interrupt edges of Hall1, Hall2 and Hall3.

Parameters:
hall1mbed pin for Hall1 input.
hall2mbed pin for Hall2 input.
hall3mbed pin for Hall3 input.

Definition at line 3 of file Hallsensor.cpp.


Member Function Documentation

int getPulses ( void   )

Read the number of pulses recorded by the encoder.

Returns:
Number of pulses which have occured, given in [count]

Definition at line 38 of file Hallsensor.cpp.

int getRevolutions ( void   )

Read the number of revolutions recorded by the encoder.

Returns:
Number of revolutions which have occured on the index channel.
void reset ( void   )

Reset the encoder.

Sets the pulses and revolutions count to zero.

Definition at line 33 of file Hallsensor.cpp.