Skip to content

Instantly share code, notes, and snippets.

View otika's full-sized avatar

Fukui Akito otika

  • Japan Nagano
View GitHub Profile
@otika
otika / http_client
Last active September 29, 2019 13:54
/*
* This sketch sends data via HTTP GET requests to data.sparkfun.com service.
*
* You need to get streamId and privateKey at data.sparkfun.com and paste them
* below. Or just customize this script to talk to other HTTP servers.
*
*/
#include <M5StickC.h>
#include <WiFi.h>
#include <M5Stack.h>
#include <Wire.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
#define VL53L0X_REG_IDENTIFICATION_MODEL_ID 0xc0
#define VL53L0X_REG_IDENTIFICATION_REVISION_ID 0xc2
#include <TimerOne.h>
#include <Thread.h> // https://github.com/ivanseidel/ArduinoThread ライブラリを管理からインストール実施
#include "SIGFOX.h"
static const String device = "NOTUSED";
static const bool useEmulator = false;
static const bool echo = true;
static const Country country = COUNTRY_JP;
static UnaShieldV2S transceiver(country, useEmulator, device, echo);
static String responce;
// M5STACK(ESP32)でiBeaconを受信してみる
// 2018/04/22 Programed by Kazuyuki Eguchi
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
static bool found = false;
int scanTime = 1; // スキャン完了までの秒数
#include <M5Stack.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <esp_wifi.h>
#include <esp_gatts_api.h>
#include <Wire.h>
// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
// Server side.
var app = require('http').createServer(handler),
io = require('socket.io').listen(app),
fs = require('fs');
app.listen(8080);
function handler(req, res) {
fs.readFile(__dirname + '/index.html', function(err, data) {
if (err) {
res.writeHead(500);
var client = require('socket.io-client');
var socket = client.connect('http://localhost:8080');
var bleacon = require('bleacon');
socket.on('connect',function(){
console.log('connected');
});
bleacon.startScanning();
bleacon.on("discover", function(beacon) {
@otika
otika / FftView.java
Last active February 4, 2017 04:26 — forked from asumin/FftView.java
Android custom view to visualize the data of FFT (works with android.media.audiofx.Visualizer)
package jp.ac.niigata_u.ie.p_sns.lib;
/**
* https://gist.github.com/asumin/8869749
*/
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.RectF;
@otika
otika / java
Created December 12, 2016 04:28
android notification
private void sendNotification() {
// Intent の作成
//Intent intent = new Intent(this, BackgroundServiceControlActivity.class);
//PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
// LargeIcon の Bitmap を生成
Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
// NotificationBuilderを作成
NotificationCompat.Builder builder = new NotificationCompat.Builder(
getApplicationContext());
//builder.setContentIntent(contentIntent);
@otika
otika / file0.txt
Last active August 29, 2015 14:11
[備忘録]LinuxMint 17.1 Cinnamon 初期設定[ja,latex,etc...][Sony VAIO Pro 11] ref: http://qiita.com/otika_telecas/items/f11c2d3d22e3da2177a0
wget -q http://packages.linuxmint-jp.net/linuxmint-ja-archive-keyring.gpg -O- | sudo apt-key add -
sudo wget http://packages.linuxmint-jp.net/sources.list.d/linuxmint-ja.list -O /etc/apt/sources.list.d/linuxmint-ja.list
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install mint-gnome-ja --install-recommends