Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78432947
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
Tue, Aug 20, 20:43
Size
552 B
Mime Type
text/x-c
Expires
Thu, Aug 22, 20:43 (2 d)
Engine
blob
Format
Raw Data
Handle
20045785
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