Hallo gunni7909,

Einen Timer für die Sensoren hätte ich gerne frei.
ich würde dazu keinen Timerinterrupt verwenden.
US-Sensoren liest man z.B. mit einem Pin-Change Interrupt aus. (Int0 oder Int1)

Also für eine SW Lösung wäre ich schon dankbar.
das wäre eine Variante:
Code:
$crystal = 16000000
$regfile = "m8def.dat"

Ddrc.0 = 1
Ddrc.1 = 1


Dim Bla As Byte
Dim Pwma As Byte
Dim Pwmb As Byte
Pwmb = 10
Pwma = 127
Do
Bla = Bla + 1
If Bla > Pwma Then
Portc.0 = 1
Else
Portc.0 = 0
End If

If Bla > Pwmb Then
Portc.1 = 1
Else
Portc.1 = 0
End If


Loop
End
Gruß, Michael