Skip to content

Instantly share code, notes, and snippets.

View tatsuro-ueda's full-sized avatar

Tatsuro Ueda tatsuro-ueda

View GitHub Profile
#encoding: utf-8
require 'miyako'
include Miyako
require "wincom"
require 'miyako_temp_lib'
# 初期化ここから
comp1 = Serial.new
comp1.open(5,0x0000,9600,8,0,0,256,256)
comp1.send("AT\r\n")
require 'net/smtp'
require 'tlsmail'
class Gmail
# 使う準備をする
def initialize(mail_address, mail_pass)
@mail_address = mail_address
@mail_pass = mail_pass
@smtpserver = Net::SMTP.new("smtp.gmail.com", 587)
@smtpserver.enable_tls(OpenSSL::SSL::VERIFY_NONE)
@tatsuro-ueda
tatsuro-ueda / _vimperatorrc
Created March 22, 2010 11:24
天気予報(降水確率付き)を取得する
command tenki :!D:\mydoc\lookup-weather-forecast.rb
@tatsuro-ueda
tatsuro-ueda / Button.pde
Created April 3, 2010 10:20
Arduinoをスピードセンサーにつなげてみた
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 5; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
// 以下は【ステップ1】で使う
const int buttonPin = 5; // the number of the pushbutton pin
int buttonState = 0; // variable for reading the pushbutton status
int counter = 0; // 10ミリ秒ごとに1ずつ増えていくカウンタ
boolean has_touched = false; // 接触直後か(チャタリング対策)
// 以下はcalc_and_display()で使う
#include <LiquidCrystal.h>
LiquidCrystal clcd(6, 7, 8, 9, 10, 11); // Arduino-0017以降
#include <stdio.h> // sprintfを使うために必要
/*************************************************
* Public Constants
*************************************************/
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
// 以下は loop() で使う
const int buttonPin = 5; // the number of the pushbutton pin
boolean buttonState = 0; // variable for reading the pushbutton status
//int counter = 0; // 5ミリ秒ごとに1ずつ増えていくカウンタ
long cycle_time = 0; // 車輪が1周するのにかかった時間(ミリ秒)
long old_millis = 0; // 前回ボタンが押された時刻
boolean has_touched = false; // 接触直後か(チャタリング対策)
// 以下は calc_and_display() で使う
#include <LiquidCrystal.h>
const int xAxisPin = 0;
const int yAxisPin = 1;
const int zAxisPin = 2;
#include "pitches.h"
// notes in the melody:
int melody[] = {
NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
// for setup()
int ledPinRed = 11;
int ledPinGreen = 10;
int ledPinBlue = 9;
// for getRandomColor()
int Color[3] = {0, 0, 0};
// for loop()
int valueRed = 0;
//シリアルライブラリを取り込む
import processing.serial.*;
//シリアルのオブジェクトmyPortを用意
Serial myPort;
//x,y,zの3個の変数を用意
int x=0;
int y=0;
int z=0;