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
#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") |
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 '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) |
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
command tenki :!D:\mydoc\lookup-weather-forecast.rb |
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
// 以下は【ステップ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を使うために必要 |
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
/************************************************* | |
* 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 |
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
// 以下は 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> |
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
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}; |
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
// for setup() | |
int ledPinRed = 11; | |
int ledPinGreen = 10; | |
int ledPinBlue = 9; | |
// for getRandomColor() | |
int Color[3] = {0, 0, 0}; | |
// for loop() | |
int valueRed = 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
//シリアルライブラリを取り込む | |
import processing.serial.*; | |
//シリアルのオブジェクトmyPortを用意 | |
Serial myPort; | |
//x,y,zの3個の変数を用意 | |
int x=0; | |
int y=0; | |
int z=0; |
OlderNewer