Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd behaviour on Nano pin 2.... #65

Open
simm42 opened this issue Aug 23, 2021 · 0 comments
Open

Odd behaviour on Nano pin 2.... #65

simm42 opened this issue Aug 23, 2021 · 0 comments

Comments

@simm42
Copy link

simm42 commented Aug 23, 2021

Hi,

I'm using EnableInterrupt for tracking the tacho pulse on several PWM controlled 4 pin PC fans - 13 fans in total split over three nanos.

Originally I was using pin 2 for one of the signals, however it was consistently reading in the region of 8 times higher than the actual fan speed. This happened on all three nanos and regardless of if I swapped the fans around.

Each of the fans were wired up the same and each used the same function provided to the enableInterrupt call (counting on falling edge):

void fanSpeedCount(){
    int fan = pin_to_fan[arduinoInterruptedPin];
    fan_times[fan][fan_next_data[fan]] = millis();
    fan_next_data[fan] = (fan_next_data[fan] + 1) % FAN_DATA_POINTS;
}

I've solved this for myself by rewiring and not using pin 2 - my suspicion is it is related to pin 2 being a hardware interrupt pin and I didn't really want to get into debugging it beyond that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant