mirror of
https://github.com/Kugelschieber/arduino-c.git
synced 2026-01-18 11:00:26 +00:00
More work on PWM and added utility function to map values.
This commit is contained in:
5
ard/util.c
Normal file
5
ard/util.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user