i am wondering why this code is not working on IDE version where i got out on 1.8.9 old version with out adding any libraries. can someone advise me some changes? #define IN_PIN A0 #define WINDOW_SIZE 20
int INDEX = 0;
int value = 0;
int sum = 0;
int reading[WINDOW_SIZE];
int averaged = 0;
void loop() {
sum = sum - reading[INDEX];
value = analogRead(IN_PIN);
reading[INDEX] = value;
sum = sum + value;
INDEX = (INDEX + 1) % WINDOW_SIZE;
averaged = sum / WINDOW_SIZE;
Hi @basilkaniyadan. Thanks for giving the Arduino IDE 2.0.0 release candidate a try.
It will not be possible for us to help you with that problem based on such a vague description. Please provide a detailed explanation of what you mean by this, including:
What did you do?
What were the results you expected from doing that?
What were the results you observed that did not match your expectations?
Make sure to include the full and exact text of any error or warning message you might have encountered.