Why not put it in one check and save a cycle?
Like this (untested):
IoannisCode:Main: Pulsin Porta.0, 1, Width 'Wait for a high pulse store the pulse width in the variable "Width." if (Width >= 925 ) and ( Width <= 975) then '1900µs is on state. 1900µs /2 = 950 high porta.1 else if (Width >= 475 ) and ( Width <= 525) then '1000µs is off state. 1000µs /2 = 500 low porta.1 'If channel 3 is indeed in the off state turn the LED off. endif endif goto Main
Bookmarks