File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -172,3 +172,30 @@ def assert_pico2000_ok(status):
172172 else :
173173 errorCheck = False
174174 raise PicoSDKCtypesError ("Unsuccessful API call" )
175+
176+ def mV2adcV2 (millivolts , rangeMax , maxADC ):
177+ """
178+ mV2adcV2(
179+ float millivolts
180+ int rangeMax
181+ c_int32 maxADC
182+ )
183+ Takes a voltage value and converts it into adc counts for psospa driver scopes
184+ """
185+ adcValue = round ((millivolts * maxADC .value )/ rangeMax )
186+
187+ return adcValue
188+
189+ def adc2mVV2 (bufferADC , rangeMax , maxADC ):
190+ """
191+ adc2mVV2(
192+ c_short_Array bufferADC
193+ int rangeMax
194+ c_int32 maxADC
195+ )
196+
197+ Takes a buffer of raw adc count values and converts it into millivolts for psospa driver scopes
198+ """
199+ bufferV = [(x * rangeMax ) / maxADC .value for x in bufferADC ]
200+
201+ return bufferV
You can’t perform that action at this time.
0 commit comments