How to make software voltage divider?