More work on PWM and added utility function to map values.

This commit is contained in:
Marvin Blum
2017-03-27 17:13:05 +02:00
parent bc2c6da436
commit 48d96d5b7d
7 changed files with 58 additions and 21 deletions

5
ard/util.c Normal file
View File

@@ -0,0 +1,5 @@
#include "util.h"
float map(float value, float fromLow, float fromHigh, float toLow, float toHigh){
return fromLow+((toHigh-toLow)/(fromHigh-fromLow))*(value-fromLow);
}