This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
require 'date' | |
require 'tempfile' | |
require 'open3' | |
=begin | |
## data file path | |
#{DATADIR}/YYYY/MM/DD.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "ssid"; | |
const char* password = "password"; | |
const char* host = "192.168.1.xx"; // server host | |
const int port = 8000; | |
void setup() | |
{ | |
Serial.begin(9600); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrick' | |
require 'webrick/cgi' | |
require 'pp' | |
require 'net/http' | |
require 'fileutils' | |
require 'time' | |
class Locked < StandardError | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#define USE_WIFI 1 | |
const char* ssid = "wifi_ssid"; | |
const char* password = "password"; | |
const char* host = "192.168.1.xxx"; | |
const int port = 8000; | |
/// デジタルIOのピンの設定 /// | |
int signPin = 16; //信号(黄) | |
const double alpha = 53.032; // cpm = uSv × alpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
// bme280 | |
// SDA=A4 SCL=A5 | |
#define BME280_ADDRESS 0x76 | |
unsigned long int hum_raw,temp_raw,pres_raw; | |
signed long int t_fine; | |
double temp_act = 0.0, press_act = 0.0,hum_act=0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
require 'fileutils' | |
require 'net/https' | |
class Locked < StandardError | |
end | |
def lock(lock_file_path='/tmp/mix1.lock') | |
File.open(lock_file_path, 'w') do |lock_file| | |
if lock_file.flock(File::LOCK_EX|File::LOCK_NB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DHT | |
#include <DHT.h> | |
#define DHTTYPE DHT11 | |
#define DHTPIN 2 | |
DHT dht(DHTPIN, DHTTYPE); | |
// gp2y | |
int measurePin = 0; //Connect dust sensor to Arduino A0 pin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int measurePin = 0; //Connect dust sensor to Arduino A0 pin | |
int ledPower = 3; //Connect 3 led driver pins of dust sensor to Arduino D2 | |
int samplingTime = 280; | |
int deltaTime = 40; | |
int sleepTime = 9680; | |
float voMeasured = 0; | |
float calcVoltage = 0; | |
float dustDensity = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "LedControl.h" | |
/* DIN CS CLK */ | |
LedControl lc=LedControl(2,4,3,1); | |
unsigned long delaytime=200; | |
void setup() { | |
/* | |
The MAX72XX is in power-saving mode on startup, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ping a remote server, also uses DHCP and DNS. | |
// 2011-06-12 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php | |
#include <EtherCard.h> | |
// ethernet interface mac address, must be unique on the LAN | |
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x32,0x31 }; | |
byte Ethernet::buffer[700]; | |
static uint32_t timer; |
NewerOlder