This commit is contained in:
eddyem 2015-02-01 00:54:16 +03:00
parent 48a3b5a31e
commit 18dbf01b15
4 changed files with 12 additions and 0 deletions

6
voltmeters/calc/K.m Normal file
View File

@ -0,0 +1,6 @@
function [u dmax] = K(U, ADU)
adu = uint32(ADU);
U = uint32(bitshift(U*1000,17));
u = uint32(U/adu);
dmax = 2*uint32(2^31/u);
endfunction

6
voltmeters/calc/Ux.m Normal file
View File

@ -0,0 +1,6 @@
function u = Ux(ADU, K)
adu = uint32(ADU);
adu *= K;
adu = bitshift(adu, -17);
u = uint32(adu);
endfunction

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB