Arduino Library in Processing

Hello ,

I wonder if there is attachinterrupt() for Arduino Library in Processing.

because when i looked into this link Arduino Playground - HomePage
i found only few function for arduino library.

Thanks,

I wonder if there is
Code: [Select]

attachinterrupt()

for Arduino Library in Processing.

How could there be? The interrupt happens on the Arduino end, not on the Processing end.

The code to deal with an interrupt needs to run on the Arduino, which won't happen when you've lobotomized it by loading a Firmata sketch.

There are, of course, other ways to make the Arduino and Processing communicate. Which end should be the master and which end should be the slave defines what the code on each end should look like.

Firmata makes the Arduino a slave. Anything requiring interrupts means that the Arduino should be the master.

Anything requiring interrupts means that the Arduino should be the master.

Not agree, in general the Arduino can be used as a preprocessing slave, some examples:

  • counts pulses (e.g. RPM) and returns the count upon request. (incl multiple pins)
  • wait for a slow sensor e.g. ADC conversion, but if master requests return the last made measurement.

In short one can add an Arduino slave as intelligent front end to (a collection of) dumb sensors (interrupt driven or not).
e.g. an Arduino as I2C slave that monitors a temp sensor and humidity sensor and can return those, but also the average, max and minimum or the humidex. The Arduino can also filter out faulty reads, count these errors and gives an uptime of the dumb sensor.

In short one can add an Arduino slave as intelligent front end to (a collection of) dumb sensors (interrupt driven or not).

Certainly. But not by installing Firmata.

thanks for your feedbacks