vienas iš variantų:

http://forum.elektronika.lt/viewtopic.php?t=81162