no it work nt ...the adc input is considired like digital input
all two outputs change in a same time...but it must change indepently with a analog input
$regfile = "attiny13.dat"
$crystal = 4800000
$hwstack = 10 ' default use 32 for the hardware stack
$swstack = 10 'default use 10 for the SW stack
$framesize = 10
' $noramclear
'Config Portb = Output
'bit7 6 5 4 3 2 1 0 ...... 1 out ,0 in
'
Config Portb = &B11101111
Config Timer0 = Pwm , Prescale = 1 , Compare A Pwm = Clear Up
'
Config Adc = Single , Prescaler = Auto , Reference = Internal
Start Adc
Reset Admux.0
Set Admux.1
Dim Idd As Word
'Alias Pinb.1
Relaisout1 Alias Portb.1
Relaisout2 Alias Portb.3
Idd = Getadc(2)
Do
Idd = Getadc(2)
Waitus 100
If Idd > 500 Then
Relaisout1 = 1
End If
If Idd < 500 Then
Relaisout1 = 0
End If
If Idd > 800 Then
Relaisout2 = 1
End If
If Idd < 800 Then
Relaisout2 = 0
End If
Loop
'rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
'rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
End