pcfens / RaspberryPi-AS3935

A basic library for working with the AS3935 that's connected to the Raspberry Pi.
Other
52 stars 24 forks source link

Time delay before reading interrupt #6

Closed RiccoRammer closed 10 years ago

RiccoRammer commented 10 years ago

Hi, I have been waiting for lightning and in the mean while trying to understand the lightning module. According to the datasheet: "Whenever an interrupt is issued, the external unit should wait 2ms before reading the Interrupt register"

Would I be correct in suggesting this within the AS3935.py?

def get_interrupt(self):
    time.sleep(0.002)
pcfens commented 10 years ago

I put this in the example lightning.py file instead of in the class itself (and delayed 3ms just to be sure).

My intention was that calling get_interrupt() would do it's thing right away and any time delays would be up to the implementer. This likely should be better documented here though for users that may not have thoroughly read the data sheet.

Any other ideas?

RiccoRammer commented 10 years ago

Ahh ok, that's cool, I just thought that if you have to wait each time before reading the data it would be best to place it in the AS3935.py library, I do appreciate the code, ps still waiting for lightning.. :-)

RiccoRammer commented 10 years ago

I wanted to let you know that the embedded adventured V4 tested fine, the address was 0x03 and the bus is 1 since I'm using a newer V2 Raspberry PI.