You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
390 B

#include "utils.h"
#include "helper.h"
int randomIntRange(int min, int max)
{
int value = randomInt();
return (value % (max - min + 1)) + min;
}
int map(int x, int in_min, int in_max, int out_min, int out_max)
{
//vgl Arduino map() https://www.arduino.cc/reference/en/language/functions/math/map/
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}