Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88592812
tachometer.c
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
Sat, Oct 19, 15:40
Size
552 B
Mime Type
text/x-c
Expires
Mon, Oct 21, 15:40 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
21544907
Attached To
R2671 HHRI-software
tachometer.c
View Options
#include "tachometer.h"
AdcChannel tac_channel;
/**
* @brief Initialize the tachometer driver.
* @param channel: the ADC channel the tachometer is wired to (0 or 1).
*/
void tac_Init(AdcChannel channel)
{
tac_channel = channel;
}
/**
* @brief Return the measured paddle angular speed.
* @retval The paddle angular speed [deg/s].
*/
float32_t tac_Get(void)
{
float32_t voltage = adc_GetChannelVoltage(tac_channel, ADC_SCALE_2_V);
// Conversion from voltage to angular speed.
return voltage * TAC_VOLTAGE_TO_RPM;
}
Event Timeline
Log In to Comment