Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Versuch20 by
EncoderCounter.h
00001 /* 00002 * EncoderCounter.h 00003 * Copyright (c) 2018, ZHAW 00004 * All rights reserved. 00005 */ 00006 00007 #ifndef ENCODER_COUNTER_H_ 00008 #define ENCODER_COUNTER_H_ 00009 00010 #include <cstdlib> 00011 #include <mbed.h> 00012 00013 /** 00014 * This class implements a driver to read the quadrature 00015 * encoder counter of the STM32 microcontroller. 00016 */ 00017 class EncoderCounter { 00018 00019 public: 00020 00021 EncoderCounter(PinName a, PinName b); 00022 virtual ~EncoderCounter(); 00023 void reset(); 00024 void reset(short offset); 00025 short read(); 00026 operator short(); 00027 00028 private: 00029 00030 TIM_TypeDef* TIM; 00031 }; 00032 00033 #endif /* ENCODER_COUNTER_H_ */ 00034 00035
Generated on Sun Jul 17 2022 11:46:13 by
