tschoeatsch schrieb:
ISR_PWM:
If Pwmchannel(0) = Pwmcount Then Reset Pinpwm0
If PWMChannel(1) = PWMCount then Reset PinPWM1
If PWMChannel(2) = PWMCount then Reset PinPWM2
If PWMChannel(3) = PWMCount then Reset PinPWM3
If PWMChannel(4) = PWMCount then Reset PinPWM4
If PWMChannel(5) = PWMCount then Reset PinPWM5
If PWMChannel(6) = PWMCount then Reset PinPWM6
If PWMChannel(7) = PWMCount then Reset PinPWM7
Incr PWMCount
If PWMCount > PWMCountMax then
PWMCount = 0
Set Porta ' Alle LED's in der Zeile An
End If
Return
Weil alle LED's anfangs eingeschaltet werden, ist es für ein gewisse Zeit an, daher geht es nicht aus.
War ein Denkfehler.
Das liegt daran, weil erst beim Erreichen des PWM-Werts die LED aus geht.
Der PWM-Count sollte vielleicht vom Maxwert nach 0 zählen.
Und dann bei den Abfragen nicht die LED löschen, sondern einschalten.
Du verstehst?
BASCOM-Quellcode
- ISR_PWM:
- If Pwmchannel(0) = Pwmcount Then Set Pinpwm0
- If PWMChannel(1) = PWMCount then Set PinPWM1
- If PWMChannel(2) = PWMCount then Set PinPWM2
- If PWMChannel(3) = PWMCount then Set PinPWM3
- If PWMChannel(4) = PWMCount then Set PinPWM4
- If PWMChannel(5) = PWMCount then Set PinPWM5
- If PWMChannel(6) = PWMCount then Set PinPWM6
- If PWMChannel(7) = PWMCount then Set PinPWM7
- If PWMCount=0 then
- PortA=0 ' Alle LED's aus
- PWMCount=PWMCountMax
- End If
- Decr PWMCount
- Return
Und diese Zeile ändern: