From 956c4bb433b65602f43ea079970b9758c630360e Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Thu, 3 May 2012 23:56:55 +0200 Subject: digital/beacon: add raw2degree() function --- digital/beacon/src/codewheel.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'digital/beacon/src/codewheel.c') diff --git a/digital/beacon/src/codewheel.c b/digital/beacon/src/codewheel.c index 092f6b57..fb8914c2 100644 --- a/digital/beacon/src/codewheel.c +++ b/digital/beacon/src/codewheel.c @@ -86,6 +86,12 @@ void codewheel_set_rebase_offset(uint16_t offset) codewheel.rebase_offset = offset; } +/* This function converts the angle value from row format to degrees */ +float codewheel_convert_angle_raw2degrees(uint16_t raw_value) +{ + return (float)raw_value*(float)360/(float)CODEWHEEL_CPR; +} + /* Codewheel complete turn IRQ vector for CodeWheel*/ ISR(TIMER3_COMPA_vect) { -- cgit v1.2.3