pins_arduino.h sample code - usage

Status
Not open for further replies.

Vaclav

New member
This site is mentioned in SerialSoftware header so I am posting this here.

I am trying to use pins_arduino.h and having heck of a time.
I can get the pin (A0) identified using this snippet in Setup:

// setup selector button
pinMode(A0, INPUT_PULLUP); // Connect to a button that goes to GND on push

#if DEBUG
debugFunction ("selector");
#endif

PCattachInterrupt(A0, SelectButton , CHANGE); // A0 = pin 8

#if DEBUG
debugFunction ("Attach interrupt selector");
#endif


I can get thru PCattachInterrupt(A0, SelectButton , CHANGE); and identify the pin 8.
I don't fully get what PCattachInterrup does ( slot?).


But I do not get to SelectButton at all when A0 goes to ground. No interrupt.


I just started using Arduino ( Uno) and have been "doing computers" since 1973.
I am little surprised how scantly are Arduino files documented / commented since it appears that the product is intended / geared for audience with lots of dreams who has a hard time to read. ( Perhaps why bother to write documentation nobody reads!)
On top of this, there are at least two of header files dealing with assigning interrupts to pins.

I could use some real sample how this header is used.

Thanks
Cheers
Vaclav
 
PCattachInterrupt(A0, SelectButton , CHANGE); // A0 = pin 8

Where did you get "PCattachInterrupt". That doesn't appear ANYWHERE in SoftwareSerial.

Code I contributed, back when it was NewSoftSerial, was only some macros, like digitalPinToPCICR, digitalPinToPCMSK, which allow it to compile on all AVR boards.

This site is mentioned in SerialSoftware header so I am posting this here.

If you're using Arduino Uno, your question really belongs on Arduino's forum:

http://forum.arduino.cc/

This forum is dedicated to Teensy & PJRC's products. It's ok to talk about other products here, but this is not the place to ask for support using them.

Like all free software, just because someone (in this case me) contributed the code for all to use for free doesn't mean you can reasonably expect technical support. That's pretty much how free software is... you get it for free, rarely with any tech support.
 
Status
Not open for further replies.
Back
Top