B4R Question attachInterrupt ?

Erel

B4X founder
Staff member
Licensed User
Longtime User
Running code from interrupts is very problematic. You can use interrupts in B4R from a library however the B4R code will run outside of the interrupt. You can see an example in the rWire library source code.

You can add listeners to pins with Pin.AddListener. This listener is not based on interrupts. The latency on Arduino Uno should be around 50 microseconds (0.05 milliseconds).
 
Upvote 0

Jaames

Active Member
Licensed User
Longtime User
I was "afraid" of similar answer , but hey, which other IDE have events attached so simple to the pin?
AFAIK there is none. With latency that small, it can replace physical interrupts on any pin .
I'm satisfied with ability to attach events to the pins . Thanks for another great product.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Hi Erel,
This will mean employ a pin just for hardware interrupt and can not use it for any other purpose. correct me if I am wrong.
will need 2 pins for maskable and non-maskable interrupts.
 
Upvote 0

Jaames

Active Member
Licensed User
Longtime User
There are many types of interrupts, but the way B4R works, hardware interrupts are almost replaceable with pin.AddListener (I se it as event in other B4X products)
 
Upvote 0
Top