AS3935
A Rust crate for ScioSense-Franklin AS3935 lightning detector sensor for generic embedded use.
Github: https://github.com/marvinrobot42/as3935-generic.git
AS3935 website: https://www.sciosense.com/as3935-franklin-lightning-sensor-ic/
The ScioSense/Franklin AS3935 lightning detector sensor with I2C interface.
All I2C API functions are implemented.
Features
- uses embedded-hal version 1.0.x
- no_std embedded compatible
- async support included as a feature, default is sync or blocking
- designed for embedded use (ESP32-C3, -C6 and -S3 and Raspberry Pi, any embedded-hal compatible)
- examples included (soon!)
- All IO functions implemented
- configurable threshold and sensivity and interrupt triggers
- set indoor or outdoor sensor location
Notes
Developed using Sparkfun AS3935 sensor model: https://www.sparkfun.com/sparkfun-lightning-detector-as3935.html
Recent version history
- 0.1.2 Added RPi example
- 0.1.1 Fixed type-o in README.md
- 0.1.0 Initial release
Usage
Add the dependency to Cargo.toml.
[]
= "0.1"
Simple Example
A more complete example is in the repository examples path
use ;
use Delay;
use ;
use info;
...
!
For async set as3935-generic dependency features = ["async"] and AS3935::new method requires async I2C and delay
parameters. Default features is sync (blocking)
Note that Raspberry Pi Rust is presently lacking a physical implementation of async i2c interface.
License
You are free to copy, modify, and distribute this application with attribution under the terms of either
- Apache License, Version 2.0 (LICENSE-Apache-2.0 or https://opensource.org/licenses/Apache-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
This project is not affiliated with nor endorsed in any way by Silicon Labs or Adafruit.