These are the core files for the Robot at Team conception.

Dependencies:   mbed UniServ

Committer:
Paulhd182
Date:
Fri May 26 08:34:21 2017 +0000
Revision:
2:644553c019c5
Added encodercounter and lowpassfilter classes; PHD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Paulhd182 2:644553c019c5 1 /*
Paulhd182 2:644553c019c5 2 * EncoderCounter.h
Paulhd182 2:644553c019c5 3 * Copyright (c) 2016, ZHAW honr
Paulhd182 2:644553c019c5 4 * All rights reserved.
Paulhd182 2:644553c019c5 5 */
Paulhd182 2:644553c019c5 6
Paulhd182 2:644553c019c5 7 #ifndef ENCODER_COUNTER_H_
Paulhd182 2:644553c019c5 8 #define ENCODER_COUNTER_H_
Paulhd182 2:644553c019c5 9
Paulhd182 2:644553c019c5 10 #include <cstdlib>
Paulhd182 2:644553c019c5 11 #include <mbed.h>
Paulhd182 2:644553c019c5 12
Paulhd182 2:644553c019c5 13 /**
Paulhd182 2:644553c019c5 14 * This class implements a driver to read the quadrature
Paulhd182 2:644553c019c5 15 * encoder counter of the STM32 microcontroller.
Paulhd182 2:644553c019c5 16 */
Paulhd182 2:644553c019c5 17 class EncoderCounter {
Paulhd182 2:644553c019c5 18
Paulhd182 2:644553c019c5 19 public:
Paulhd182 2:644553c019c5 20
Paulhd182 2:644553c019c5 21 EncoderCounter(PinName a, PinName b);
Paulhd182 2:644553c019c5 22 virtual ~EncoderCounter();
Paulhd182 2:644553c019c5 23 void reset();
Paulhd182 2:644553c019c5 24 void reset(short offset);
Paulhd182 2:644553c019c5 25 short read();
Paulhd182 2:644553c019c5 26 operator short();
Paulhd182 2:644553c019c5 27
Paulhd182 2:644553c019c5 28 private:
Paulhd182 2:644553c019c5 29
Paulhd182 2:644553c019c5 30 TIM_TypeDef* TIM;
Paulhd182 2:644553c019c5 31 };
Paulhd182 2:644553c019c5 32
Paulhd182 2:644553c019c5 33 #endif /* ENCODER_COUNTER_H_ */