OK, the penny's dropped...
mon = 16 bits, whilst width = 8 bits... you can't put a quart into a pint pot...
try...
width = mon/4
In case you're wondering why /4 instead of /8... that's because your ADC reading is 10 bits. So why not read 8-bit ADC to start with?
Bookmarks