Portb= &B00000000
'Now give power to the chip Start Adc
Admux = &B00000000 ' Aref Selection
Dim Adc_value AsDword , Adc_channel AsByte , Lastvalue(8)AsSingle Dim R AsSingle , I AsSingle , V1 AsSingle , V2 AsSingle Dim Lowvalue AsSingle , Highvalue AsSingle Dim Temp AsByte
Do Incr Adc_channel
If Adc_channel =8Then
Adc_channel =0 End If
Adc_value =Getadc(ADC_Channel)+1 ' Voltage Across Uknown Resistor
V1 =0.002* Adc_value
' Voltage Across known resistor 5600 ohm
V2 =2.048- V1
' current through our resistor
I = V2 /51000
R = V1 / I
Print"C "; Adc_channel
Print"R = "; R
Print"lv "; Lastvalue(adc_channel)
' hold current value to check it later
Lastvalue(adc_channel)= R
Print"-" Waitms3000
Loop End
(BASCOM-AVR version : 2.0.7.8 )
Last edited by plouf on Fri Jun 19, 2015 6:32 am; edited 1 time in total
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum