Home › Forums › Environmental Sensors › MayFly Capability with Northern Widget Walrus Sensor › Reply To: MayFly Capability with Northern Widget Walrus Sensor
2020-11-02 at 11:33 AM
#14769
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
// Include the Walrus library #include "Walrus_I2C.h" // Declare variables -- just as strings String header; String data; // Instantiate class Walrus myWalrus; void setup(){ // Begin Serial connection to computer at 38400 baud Serial.begin(38400); // Obtain the header just once header = myWalrus.getHeader(); // Print the header to the serial monitor Serial.println(header); } void loop(){ // Take one reading every (10 + time to take reading) seconds data = myWalrus.getString(); // and print it to the screen Serial.println(data); delay(10000); // Wait 10 seconds before the next reading, inefficiently } |