Pages: [1]   Go Down
Author Topic: using interrupt and the pull up resistor on the same pin  (Read 2899 times)
0 Members and 1 Guest are viewing this topic.
South East USA
Offline Offline
God Member
*****
Karma: 5
Posts: 655
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can I use the internal pull-up resistor with an attachInterrupt at the same time on the same pin?


Code:
attachInterrupt(0, CountPulse, RISING);//turn on interrupt for flow sensor on pin 2
digitalWrite(2, HIGH);  //turn on pull up resistor for flow sensor on pin 2

Will this do away with the need of the 10K resistor in the example for this sensor:
http://www.seeedstudio.com/forum/viewtopic.php?f=4&t=989&start=0
thanks!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 546
Posts: 27361
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.
Maybe do away. Internal may not have enough oomph to pull up by itself.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19080
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The internal pull-ups are spec'd as being 20K to 50K, so maybe typically 35K? Not exactly the same as 10K. It might work, as CrossRoads said.
Logged


Pages: [1]   Go Up
Jump to: