1. mistake:
You defined the variable COUNTER on PARTA. Why ?
If you read this 8 bits back, they represent the digital attached signals from the pins.
You should define it as a simple variable (Var byte).
2....:
you write to Counter, but never read it back ?
3....:
maybe you can throw away the if-thens by using counter=Potenzial*10/256 with some other steps
Bookmarks