Giter VIP home page Giter VIP logo

as3935-arduino-library's Introduction

AS3935-Arduino-Library

AS3935 Franklin Lightning Sensor™ IC by AMS Arduino library for I2C

This is the modification of the library by Raivisr     http://www.rrkb.lv

See his page for detais. This modification changes SPI to I2C communication.

This is modified to use interrupt for calibration

setTune can be used to bypass calibration

Tested with Arduino 1.0.3 on Arduino Pro Mini.

Short function reference:

void registerWrite(byte reg, byte mask, byte data)

    write to specified register specified data using specified bitmask,     the rest of the register remains intact

byte registerRead(byte reg, byte mask)

    read specified register using specified bitmask and return value aligned     to lsb, i.e. if value to be read is in a middle of register, function     reads register and then aligns lsb of value to lsb of byte

void reset()

    reset all the registers on chip to default values

bool calibrate()

    perform calibration routine, calibrate receiving antenna tank and then     instruct the chip to calibrate both RCOs present on chip

void powerDown()

    put chip into power down mode

void powerUp()

    bring chip out of power down mode and perform RCO calibration

int interruptSource()

    return interrupt source, bitmask, 0b0001 - noise, 0b0100 - disturber,     0b1000 - lightning

void disableDisturbers()

    disable indication of disturbers

void enableDisturbers()

    enable indication of distrubers

int getMinimumLightnings()

    return number of lightnings that need to be detected in 17 minute period     before interrupt is issued

int setMinimumLightnings(int minlightning)

    set number of lightnings that need to be detected in 17 minute period     before interrupt is issued

int lightningDistanceKm()

    return distance to lightning in kilometers, 1 means storm is overhead,     63 means it is too far to reliably calculate distance

void setIndoors()

    load gain preset to operate indoors

void setOutdoors()

    load gain preset to operate outdoors

int getNoiseFloor()

    return noise floor setting - refer to datasheet for meaning and range

int setNoiseFloor(int noisefloor)

    set noise floor setting

int getSpikeRejection()

    return spike rejection value - refer to datasheet for meaning and range

int setSpikeRejection(int srej)

    set spike rejection value

int getWatchdogThreshold()

    return watchdog threshold value - refer to datasheet for meaning and range

int setWatchdogThreshold(int wdth)

    set watchdog threshold value

void clearStats()

    clear internal accumulated lightning statistics

as3935-arduino-library's People

Contributors

albalogic avatar chatelao avatar raivisr avatar slomusti avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.