Project

General

Profile

Jeenode Micro interrupts

Added by alberani about 5 years ago

Can someone point me to a working example of interrupt handling on Jeenode micro (on the I pin or any other pin)?

I’ve tried with the usual attachInterrupt(1, cb, CHANGE) code, but no luck. I’ve also tested various libraries, like PinChangeInterrupt and PinChangeInt, without success.

Thanks!


Replies (7)

RE: Jeenode Micro interrupts - Added by alberani about 5 years ago

JohnO wrote:
> I use the enclosed code with success.

Impressive work! :-)

In the end, it seems that referring to the pin using the correct number is enough; right now I’ve something like:

#include 

  [...]

attachPcInterrupt(3, cb, CHANGE);

and it seems to work fine. It probably works also with attachInterrupt, but I’ve not yet tested it.

Anyway, your code seems to do a lot more magic to preserve the battery, so I’ll surely try to integrate it.

Thank you very much!

RE: Jeenode Micro interrupts - Added by JohnO about 5 years ago

I’m glad you got it running. I claim very little of what is in the sketch, I’m a code magpie. The battery stuff really works, one of the units is up to 14 months now - I think that is @jcw’s craftsmanship.

RE: Jeenode Micro interrupts - Added by Mars about 5 years ago

JohnO wrote:
> […]I’m a code magpie.[…]
Hmmm, not sure what that is exactly (I could guess though), but looking at the Urban Dictionary for “Magpie” you are something like:
# Someone who hangs at the train station or bus stop or anywhere public all day long, usually asking for a cigarette, spare change or pocket lint. Usually unemployed and unemployable, using nothing but slang, and usually impossible to get rid of, until threatened with violence.
Called magpies because if they have gotten it once, they’ll expect it again, and again, regardless of who it is.
# Slang for a member of the Newcastle United Football Club (NUFC). This is due to the fact that their strip is black and white.
# poxy bird magpie, that squalks outside ya bedroom window at ungodly hours til you wake with a bad head, then shuts the fukk up, leaving you in a stinking mood all day.
# a person who takes your problem, issue , or situation, and owns it as theirs.
This person turns it to somehow affecting them, and will broadcast it as widely as required in order to get the desired level of sympathy. A magpie will even sacrifice friendships to maintain her/his position.
# Given the opportunity the Magpie will always steal the shinny goodness. It is from this notion that the term “Magpie” is derived. The steeling of the golden moment through covert photography. The subject - Always an unsuspecting young lady. “Look…..that girl is bending over. Quick! Pass me your Phone Camera……..i’ll Magpie her”
# One who never shuts up, and snitches on others.
# Somebody who talks like a bird and doesn’t shut up! They tend to talk fast and loud! They also are hard to understand, due to the fact that the sound that comes from their voicebox is more or less like a Raven

And then there is another one (number 8), but to put that explanation on this board…Hmmmmm

RE: Jeenode Micro interrupts - Added by JohnO about 5 years ago

:-), you continentals live such colourful lives. Number 5 just about it, I collect useful pieces of shiny C code to make my nest attractive.

RE: Jeenode Micro interrupts - Added by Lahorde about 5 years ago

Hi,

> In the end, it seems that referring to the pin using the correct number is enough; right now I’ve something like:
>
> #include
>
> […]
>
> attachPcInterrupt(3, cb, CHANGE);
> and it seems to work fine. It probably works also with attachInterrupt, but I’ve not yet tested it.

attachInterrupt() does not work with core source files https://github.com/jcw/ide-hardware
I haven’t seen such issues in https://code.google.com/p/arduino-tiny/issues/list
I can create a new one if needed.

Lahorde

RE: Jeenode Micro interrupts - Added by Lahorde about 5 years ago

I added issue Bug #450

    (1-7/7)