| Electronic Components Datasheet Search |
|
DEV-13956 Datasheet(PDF) 10 Page - SparkFun Electronics |
|
|
|||||||||||||||||||||||||||||
DEV-13956 Datasheet(HTML) 10 Page - SparkFun Electronics |
|
10 / 26 page ![]() //============================ //Interrupt routines (these are called by the hardware interru pts, not by the main code) //============================ void rainIRQ() // Count rain gauge bucket tips as they occur // Activated by the magnet and reed switch in the rain gauge, attached to input D2 { raintime = millis(); // grab current time raininterval = raintime rainlast; // calculate interval between this and last event if (raininterval > 10) // ignore switchbounce glitches le ss than 10mS after initial edge { dailyrainin += 0.011; //Each dump is 0.011" of water rainHour[minutes] += 0.011; //Increase this minute's a mount of rain rainlast = raintime; // set up for next event } } void wspeedIRQ() // Activated by the magnet in the anemometer (2 ticks per rota tion), attached to input D3 { if (millis() lastWindIRQ > 10) // Ignore switchbounce g litches less than 10ms (142MPH max reading) after the reed swi tch closes { lastWindIRQ = millis(); //Grab the current time windClicks++; //There is 1.492MPH for each click per s econd. } } void setup() { Serial.begin(9600); Serial.println("Weather Shield Example"); pinMode(STAT1, OUTPUT); //Status LED Blue pinMode(STAT2, OUTPUT); //Status LED Green pinMode(WSPEED, INPUT_PULLUP); // input from wind meters w indspeed sensor pinMode(RAIN, INPUT_PULLUP); // input from wind meters rai n gauge sensor pinMode(REFERENCE_3V3, INPUT); pinMode(LIGHT, INPUT); //Configure the pressure sensor myPressure.begin(); // Get sensor online myPressure.setModeBarometer(); // Measure pressure in Pasc als from 20 to 110 kPa myPressure.setOversampleRate(7); // Set Oversample to the recommended 128 myPressure.enableEventFlags(); // Enable all three pressur e and temp event flags Page 10 of 26 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |