You want to use INPUT mode not INPUT_PULLUP. External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2).The 5V pull-up needs to be 5V on the Arduino Board.All Grounds on the arduino should be tied together.In this post I found that I had to do the following to make sure I was getting the least noise on the pins: I have another post talking about accurately measuring RPM. I'm initializing each of the pins as either:ĪttachInterrupt(pinNumber, counterfcn, RISING) ĪttachInterrupt(digitalPintoInterrupt(pinNumber), counterfcn, RISING) (there will be two more fans connected to 2, 3) Pin 19 is reading correctly, Pins 20 and 21 read 0. External Interrupts: Pins 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2) can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. Each symbol is in the form DxxPyzEXTu, where xx is the pin number on. Here is a schematic of 3 fans connected to pins 19, 20, and 21. Also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip. Defines all digital output pins of ATmega2560, usable as direct external interrupt pins. The other pins seem to be offsetting my signal by anywhere from 1 - 2.5V and the change is not not being detected. Right now I can only read RPM on pins 18 and 19. I would like to use all the interrupt pins on the Arduino MEGA 2560 to simultaneously read RPM from different fans.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |