I changed the value to 1022 and the led lit and occasionally flicked off then back on, so right at the end of the 10bit conversion / pot sensitivity. At a value of 1 the led lit with some pot 'travel' still left. So pretty spot on I'd say:
Mmm, interesting. I want to transmit the data (days total count) when it's dark and the parents have stopped feeding the young for the day. Like you say though, I don't want say the garden PIR light (when the Badger arrives) to effect things so some averaging and tweaking / testing needed here.And for you project you may want to play with some averaging. Analog will tend to drift with a temperature flux (resistors) or more so for your application how sensitive you want the LDR (stray car lights?).
As ever a big thank you for the 8bit ADC program pointer mackrackit. When it came to doing the 10bit conversion I've learned a lot about setting REGISTER bits, I'm still painfully slow but I guess that will improve with time / practise really interesting learning though.
Just spotted that this should read ADFM BIT7=1= right justifiedCode:ADFM BIT1= right justified
And as for WEND, I suppose elegant would be the word.
Dave
Bookmarks