Skip to content

Instantly share code, notes, and snippets.

@shunkino
shunkino / 改善版
Created July 18, 2015 10:18
ESP+2.4 LED
#include <doxygen.h>
#include <ESP8266.h>
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library 機種依存のライブラリ
//ESP用のマクロ
#define SSID "your_SSID"
#define PASSWORD "your_key"
#define HOST_NAME "your_host_name"
@shunkino
shunkino / webrokeup.html
Last active August 29, 2015 14:26 — forked from gucchan22/webrokeup.html
We broke up
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>We broke up</title>
<link href='http://fonts.googleapis.com/css?family=Cookie' rel='stylesheet' type='text/css'>
<style type="text/css">
div#question {
font-size:4em;
font-family: 'Cookie', cursive;
@shunkino
shunkino / driver
Last active October 26, 2015 08:22
ricoh
http://faq.ricoh.jp/app/answers/detail/a_id/1527/session/L2F2LzEvdGltZS8xNDQ1ODQxOTExL3NpZC9FNVQtY1V6bQ%3D%3D
http://support.ricoh.com/bbv2/html/dr_ut_d/new/history/w/bb/pub_j/dr_ut_d/4101013/4101013911/V1111/5184339/Ricoh-Basic-PS-PPDv1.11.1.tar/history.html
http://www.openprinting.org/download/printdriver/debian/dists/lsb3.2/main/binary-amd64/openprinting-ppds-postscript-ricoh_20140829-1lsb3.2_all.deb
@shunkino
shunkino / .vimrc
Created November 5, 2015 07:17
my vimrc
"*****************************************************************************
"" NeoBundle core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

ESP8266チップで自作のプログラムを実行する

この記事は慶應義塾大学SFC村井&徳田研 Advent Calendar 2015の17日目です。

-- (多分)アドベントカレンダー内唯一のマイコンの話です。ESP8266というチップをご存知ですか?Wi-FiアンテナとTCP/IPプロトコルスタックが搭載されたモジュール(厳密には搭載されているSoCを指します)です。国内外で今年流行ってますね。流行ってるんです。今回はこれを利用して自作のプログラムを実行する方法を書こうと思います。目標はHello, worldです。無線関係ない・・・

今回はRTOS_SDKというSDKを利用してプログラムをコンパイルします。

背景

@shunkino
shunkino / adxl345.js
Last active March 6, 2017 03:09
ADXL345 driver for chirimen.
function changeToSignedInt(number) {
if (number >> 15) {
ret = 65536 - number;
return ret * -1;
} else {
return number;
}
}
var adxl345 = {
@shunkino
shunkino / user_main.c
Created January 26, 2016 09:08
ADXL345 and ESP8266
#include "esp_common.h"
#include "i2c.h"
#include "freertos/FreeRTOS.h"
#include "lwip/sockets.h"
#include "lwip/dns.h"
#include "lwip/netdb.h"
#define SSID ""
#define PASS ""
#define TCP_PORT 3080

ESP8266

概要

ESP8266を利用するにあたりめちゃくちゃたくさん困ったので、これから取り組む人が苦労することのないようにその過程で得られた知識を書きます。フォーラムが中心となっていることも有り特に日本語では情報収集が困難だったのでまとめます。最近では優れたなESP8266関連の記事もあるので、そちらの内容も是非参考にしてください。

この記事の環境

  • Mac OS X Yosemite 10.10.5
  • Python 2.7.10

ESP8266とは

無線経由でインターネットに接続するための機能が一式詰まったSoC。プロトコル・スタックが全て載っているため、プログラマは一番面倒くさいところを書かなくて済む。最近日本でも技適を取得したバージョンESP-WROOM-02が発売されブレイク中。海外ではフォーラムで情報交換や開発が進んでいる。

@shunkino
shunkino / index.js
Last active September 7, 2018 03:46
extracted from the interface-ipfs-core
'use strict'
// var IPFS = require('ipfs-api')
var IPFS = require('../../src/')
var ipfs = IPFS()
function store () {
var toStore = document.getElementById('source').value
ipfs.files.add(Buffer.from(toStore), function (err, res) {
@shunkino
shunkino / src_pubsub.js
Last active September 7, 2018 04:37
pubsub change
'use strict'
const promisify = require('promisify-es6')
const EventEmitter = require('events')
const eos = require('end-of-stream')
const isNode = require('detect-node')
const setImmediate = require('async/setImmediate')
const PubsubMessageStream = require('./utils/pubsub-message-stream')
const stringlistToArray = require('./utils/stringlist-to-array')
const moduleConfig = require('./utils/module-config')