# LCENJ CC0-1.0. Ideal calculations, not measured hardware results.
import math,json
vdd=3.3
rows=[{"code":n,"ideal_V":vdd*n/4096} for n in [0,1024,2048,3072,4095]]
assert math.isclose(vdd/4096,0.0008056640625)
assert math.isclose(rows[2]["ideal_V"],1.65)
assert math.isclose(rows[-1]["ideal_V"],3.2991943359375)
assert math.isclose(0.8473*4700*100e-12,398.231e-9)
assert 0.8473*4700*100e-12 > 300e-9
assert math.isclose(1/(2*math.pi*1000*100e-9),1591.5494309189535)
assert math.isclose(3.3/(1000+10000)*10000,3.0)
assert math.isclose((27/100000)*1000,0.27)
print(json.dumps({"ideal":rows,"LSB_mV":1000*vdd/4096,"hypothetical_only":True},indent=2))
