countbin = Dec2Bcd16(count) ' conversione da decimale a binario
final= countbin
if (count =0) then portb=255 portc=255 portd=255
else
if (count<100) then portb = not final portc=255 portd=255
else
if (count >99) then portb=final
if (count<10000) then final=(final-255) portc=not final portd=255
else
if (count >9999) then portb=0 portc=0
'else
'if (count<300000) then portb = not final portc=255 portd=255
' else if (count >9999) then portb=0 portc=0
' end if
end if
end if
end if
end if
end if