This file contains hidden or 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
$pat = ARGV | |
# usage: | |
# ruby bin2c.rb symbol input > output | |
sym = $pat[0] | |
fin = open $pat[1], "rb" | |
printf "\n\nconst unsigned char %s[] = {\n", sym |
This file contains hidden or 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
#ifndef FIBER_H | |
#define FIBER_H | |
#define FIBER_NEST_ENABLE 1 | |
typedef void* fiber_t; | |
#define FIBER_INIT { ((void*)0) } | |
#define FIBER_LINE2(x) FIBER_LINE_ ## x | |
#define FIBER_LINE(x) FIBER_LINE2(x) |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <sys/time.h> | |
static double getdiff(const struct timeval &t1, const struct timeval &t2) | |
{ | |
return (t2.tv_sec - t1.tv_sec) + 1.0 * (t2.tv_usec - t1.tv_usec) / 1000000; | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<fonts> | |
<fontset id="Default"> | |
<font> | |
<name>XLarge</name> | |
<filename>NotoSans-Regular.ttf</filename> | |
<linespacing>0.94</linespacing> | |
<size>48</size> | |
</font> | |
<font> |
This file contains hidden or 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> | |
#include <GridEye.h> | |
GridEye myeye; | |
void setup(void) | |
{ | |
// I2Cバスに参加 | |
Wire.begin(); | |
// フレームレートを10に設定 |
This file contains hidden or 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> | |
#include <GridEye.h> | |
GridEye myeye; | |
void setup(void) | |
{ | |
// I2Cバスに参加 | |
Wire.begin(); | |
// シリアルポート初期化 |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import smbus | |
class GridEye: | |
__REG_FPSC = 0x02 | |
__REG_TOOL = 0x0E | |
__REG_PIXL = 0x80 |
This file contains hidden or 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 <Adafruit_HDC1000.h> | |
// センサーデータを読み込む間隔(us) | |
const int WAKEUP_INTERVAL = 15 * 1000 * 1000; | |
// HDC1000モジュールアクセス用変数 | |
Adafruit_HDC1000 hdc = Adafruit_HDC1000(); | |
// TOUTの代わりにVcc電圧を読めるように設定する | |
ADC_MODE(ADC_VCC); |
This file contains hidden or 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 <ThingSpeak.h> | |
#include <ESP8266WiFi.h> | |
#include <Adafruit_HDC1000.h> | |
// 起床間隔 | |
const unsigned long WAKEUP_INTERVAL = 5 * 60 * 1000 * 1000; // 5分 | |
// アップロード閾値 | |
const float TEMPERATURE_TH = 0.5; // 0.5度 | |
const float HUMIDITY_TH = 2.0; // 2.0% |
This file contains hidden or 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
// the setup function runs once when you press reset or power the board | |
void setup() { | |
// initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(1000); // wait for a second |
OlderNewer