This program is for an autonomous robot for the competition at the Hochschule Luzern. We are one of the 32 teams. <a href="http://cruisingcrepe.wordpress.com/">http://cruisingcrepe.wordpress.com/</a> 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: <a href="http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf">http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf</a>
Fork of autonomousRobotAndroid by
Actuators/Hallsensor.h
- Committer:
- chrigelburri
- Date:
- 2013-03-23
- Revision:
- 6:48eeb41188dd
- Parent:
- 3:92ba0254af87
- Child:
- 11:775ebb69d5e1
File content as of revision 6:48eeb41188dd:
#ifndef HALLSENSOR_H #define HALLSENSOR_H #include "mbed.h" /** * @author Christian Burri * * @section LICENSE * * Copyright © 2013 HSLU Pren Team #1 Cruising Crêpe * All rights reserved. * * @section DESCRIPTION * * Interface to count the Hallsensor input from a EC-Motor. * */ class Hallsensor { private: /** * Update the pulse count. * Called on every rising/falling edge of Hall 1-3. * Reads the state of the channels and determines whether a pulse forward * or backward has occured, updating the count appropriately. */ void encode(void); InterruptIn hall1_; InterruptIn hall2_; InterruptIn hall3_; int prevState_; int currState_; volatile int pulses_; public: /** * Constructor of the class <code>Hallsensor</code>. * * 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. * @param hall1 mbed pin for Hall1 input. * @param hall2 mbed pin for Hall2 input. * @param hall3 mbed pin for Hall3 input. */ Hallsensor(PinName hall1, PinName hall2, PinName hall3); /** * Reset the encoder. * Sets the pulses and revolutions count to zero. */ void reset(void); /** * Read the number of pulses recorded by the encoder. * @return Number of pulses which have occured, given in [count] */ int getPulses(void); /** * Read the number of revolutions recorded by the encoder. * @return Number of revolutions which have occured on the index channel. */ int getRevolutions(void); }; #endif /* Hallsensor_H */