Ignore first sample from ADC
ADC of AVR contains a 'bug' that causes first sample to be corrupt. Fixed in code now.
This commit is contained in:
parent
ff698171aa
commit
6cf277c1fe
|
@ -194,6 +194,9 @@ void setup()
|
|||
pinMode(LED4PIN, OUTPUT);
|
||||
|
||||
analogReference(DEFAULT);
|
||||
// known 'bug' in AVR ADC: after switching analog reference, first sample
|
||||
// could be corrupt and should be ignored --> discard this sample now
|
||||
analogRead(LIGHTSENSOR_INPUTPIN);
|
||||
|
||||
current_brightnes=MAXBRIGHTNESS;
|
||||
|
||||
|
|
Loading…
Reference in New Issue