Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F62442074
tachometer.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, May 13, 05:42
Size
812 B
Mime Type
text/x-c
Expires
Wed, May 15, 05:42 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17647187
Attached To
R2671 HHRI-software
tachometer.h
View Options
#ifndef __TACHOMETER_H
#define __TACHOMETER_H
#include "../main.h"
#include "adc.h"
#define TAC_RPM_TO_VOLTAGE 0.00052f
// According to the Maxon DC Tacho DCT 22 datasheet [V/RPM].
#define TAC_VOLTAGE_TO_RPM (1/TAC_RPM_TO_VOLTAGE)
// [RPM/V].
/** @defgroup Tachometer Driver / Tachometer
* @brief Driver for a tachometer.
*
* This driver uses an ADC input, ANIN1 or ANIN2 (see ADC).
* To use this, connect wire the sensor as this:
* * tacho 1 -> ANINX+ (pin 3 or 7 of J2).
* * tacho 2 -> ANINX- (pin 4 or 8 of J2).
*
* Set the sensitivity switches to +-2V.
*
* Call tac_Init() first in the initialization code. Then, call tac_Get() to
* get the motor speed.
*
* @addtogroup Tachometer
* @{
*/
void
tac_Init
(
AdcChannel
channel
);
float32_t
tac_Get
(
void
);
/**
* @}
*/
#endif
Event Timeline
Log In to Comment