I would just create a function in DBPro that does the calculation:
convert the Arduino function :
long map(long x, long in_min, long in_max, long out_min, long out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
to a DBPro function:
function map(x as dword, in_min as dword, in_max as dword, out_min as dword, out_max as dword)
r as dword
r = (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
endfunction r
let me know if I've misunderstood, but as a stats programmer who uses SAS, this is what I would do in DBPro as there isn't a function / command that does this.
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others