Skip to content

Instantly share code, notes, and snippets.

const int selectPins[3] = {9, 6, 11}; // S0, S1, S2
#define MUXPIN 6
#define FREQUENCY 30000
#define LED_PIN 5
#define CPU_HZ 48000000
/*
WiFi Web Server LED Blink
A simple web server that lets you blink an LED via the web.
This sketch will create a new access point (with no password).
It will then launch a new server and print out the IP address
to the Serial monitor. From there, you can open that address in a web browser
to turn on and off the LED on pin 13.
If the IP address of your shield is yourAddress:
/*
WiFi Web Server LED Blink
A simple web server that lets you blink an LED via the web.
This sketch will create a new access point (with no password).
It will then launch a new server and print out the IP address
to the Serial monitor. From there, you can open that address in a web browser
to turn on and off the LED on pin 13.
If the IP address of your shield is yourAddress:
#include <Wire.h>
#include "MS5837.h"
MS5837 sensor;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
@dwblair
dwblair / user_dat_iot.md
Last active November 29, 2017 19:12
User scenarios for IOT and dat protocol

Goal: to enable farmers, researchers, and municipalities to collect sensor data (farm management, land and water resource management, laboratory instrumentation) into some local data archive.

It'd be nice to use DAT for this:

  • DAT makes it easy to keep track of versions of the datasets (Content addressing.)
  • DAT makes it easy and efficient to share the datasets. (Only need to transmit file differentials. Particularly appropriate for timeseries data that is only generated sporadically, and is generally simply appended to the prior dataset.)
  • DAT allows for the datasets to be easily replicated and decentralized. (Easy to make backup copies. Easy to share full datasets in a 'mesh network' scenario -- off-grid farms, research lab in field / at sea, town that experiences a power outage, etc)

For simple applications that simply require collecting sensor data (in, e.g., a CSV file) and sharing it as a DAT archive, command line interaction with DAT, and talking to microcontrollers over USB, is

/* Blue Robotics MS5837 Library Example
-----------------------------------------------------
Title: Blue Robotics MS5837 Library Example
Description: This example demonstrates the MS5837 Library with a connected
sensor. The example reads the sensor and prints the resulting values
to the serial terminal.
The code is designed for the Arduino Uno board and can be compiled and
/***************************************************************************
This is a library for the BME280 humidity, temperature & pressure sensor
Designed specifically to work with the Adafruit BME280 Breakout
----> http://www.adafruit.com/products/2650
These sensors use I2C or SPI to communicate, 2 or 4 pins are required
to interface. The device's I2C address is either 0x76 or 0x77.
Adafruit invests time and resources providing this open source code,
// which analog pin to connect
#define THERMISTORPIN A1
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000
// temp. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25
// how many samples to take and average, more takes longer
// but is more 'smooth'
#define NUMSAMPLES 5
// The beta coefficient of the thermistor (usually 3000-4000)

Test of formatting

What's up with this.

#include <SPI.h>
#include <RH_RF95.h>
// for feather m0
#define RFM95_CS 8
#define RFM95_RST 4
#define RFM95_INT 3
//#define RF95_FREQ 915.0