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

Any chance you could add an SPI interface option as well? #32

Closed mytechguyri closed 2 years ago

mytechguyri commented 2 years ago

With the known issues with this device on the I2C bus (according to sparkfun) its recommended to run it on the SPI bus instead

I can get it working on SPI with other available libraries, but no interrupt support. All the current libararies for this device that support SPI are written for CircuitPython, which doesn't support interrupts.... so makes it kind of difficult to conduct any asynchronous events on the Pi with it.

pcfens commented 2 years ago

Getting a library put together for SPI has been on my todo list for a while, but since it'd require a significant rewrite it'd end up in a different library instead of this one.

The interrupt handler used in demo.py is from the RPi.GPIO library, not this one, so you can likely re-purpose pieces there with an existing SPI library without too much trouble.