2013-01-01から1年間の記事一覧

Arduinoと3Dプリンタで猫のおもちゃをつくる

Arduinoのコード #include <stdint.h> #include <avr/interrupt.h> #include <avr/io.h> #include <avr/pgmspace.h> #define SAMPLE_RATE 8000 #include "sounddata.h" int ledPin = 13; int speakerPin = 11; // Can be either 3 or 11, two PWM outputs connected to Timer 2 int tiltPin = 3; volatile uint16_t</avr/pgmspace.h></avr/io.h></avr/interrupt.h></stdint.h>…

FabmoduleでModelaを使う際のパラメータ

ミリング エンドミルは0.3mmを使う。銅箔の厚みのソース http://jp.rs-online.com/web/p/plain-copper-ink-resist-boards/4538723/ ドリリング エンドミルは0.8mmを使う。

MIDIのフォーマット

ここが参考になる。 http://www2s.biglobe.ne.jp/~yyagi/material/smfspec.html#deltatime MIDIキーボードを拾ってみた。 ド・ミ・ソ 90 noteON 34 note 55 vel 37 note 55 vel 30 note 55 vel 30 note 0 vel 34 note 0 vel 37 note 0 vel うまくいっていな…

マイコンでスイッチを使うとき

RubyのShoesでGUIプログラミング

おもしろい。 Shoes.app do flow margin: 12 do # Set up three buttons @one = button "One" @two = button "Two" @three = button "Three" # Bounce the second button @one.click do |button| alert "You are No.1!" end @two.click do |button| alert "T…

rubyでTwitterのメンションを待ち受ける

require 'tweetstream' TweetStream.configure do |config| config.consumer_key = 'xxx' config.consumer_secret = 'xxx' config.oauth_token = 'xxx' config.oauth_token_secret = 'xxx' config.auth_method = :oauth end client = TweetStream::Client.ne…

emacsで選択部分をコメントアウトする

リージョンを選択してから M - ; (メタキー+セミコロン)でできる。

Raspberry piを無線LANのアクセスポイントにする

Linuxで動きそうなUSBアンテナを探す http://d.hatena.ne.jp/nayutaya/20120825/1345877309これとか Amazonだともう売ってない http://www.amazon.co.jp/exec/obidos/ASIN/B00439HZ3Y/nayutaya04-22/ref=nosimヨドバシで買えそう http://www.yodobashi.com/e…

Fab-Fiのレーザーカットファイル

http://fabfi.fabfolk.com/distribution/

Arduinoから猫の鳴き声を出力する

1.猫の鳴き声を落としてくる(wavファイル) http://www.kessels.com/catsounds/ 2.AudacityでWAVを開きリサンプリングしてWAVにExportする リサンプリング要求はMono、8bit PCM(unsigned)、8000Hz、音源は3秒間以下(※) ※8kHz x 4秒 = 32k Byte(一音を1バ…

アーク溶接を検討する

IMAX60がおすすめらしい インバータ式、100V15Aでも結構行けるとか・バッテリーを直列して出力UP http://masa-ya.jp/index.php?%BC%AB%BA%EE%B9%A9%B6%F1%2F%A5%D0%A5%C3%A5%C6%A5%EA%A1%BC%CD%CF%C0%DC%B5%A1・IMAX60を買った記事 http://take2tech.blog.fc…

ステッピングモータドライバL6740を動かした時のメモ

以下は最高速度まで行かなかった時のコード 一応メモSPIライブラリを使って自作した方 /* * All A pins of AD5206 connected to +5V * All B pins of AD5206 connected to ground * An LED and a 220-ohm resisor in series connected from each W pin to gr…

Node.jsでArduinoとシリアル通信する

ここを参考に。 http://tomowatanabe.hatenablog.com/entry/2013/03/23/233554Arduino側のコードはそのまま使う。 serial.ino #define TEMP A5 #define LED 13 int value; // アナログ入力値(0〜203) int tempC = 0; // 摂氏値( ℃ ) char trans[20]; // 数字…

Socket.ioで一定時間おきにサーバーからクライアントにデータを送信する

大体やりたいことができるようになってきた。 var express = require("express"); var app = express(); var io = require("socket.io").listen(app.listen(3000)); //express code app.get("/",function(req,res){ res.sendfile(__dirname + '/index.html')…

Socket.ioでサーバ側からクライアントに送信する際の書き方について

・setTimeoutの使い方、関数の評価タイミング ・io.connectの中のsocket変数のスコープ というJavaScriptの基本的なところの勉強になる。app.js var express = require("express"); var app = express(); var io = require("socket.io").listen(app.listen(3…

ExpressとWebsocketを使う

サーバー側でのioオブジェクトの宣言が間違っていたみたいで無駄にハマった。 var ioの宣言はここを参考に http://net.tutsplus.com/tutorials/javascript-ajax/real-time-chat-with-nodejs-socket-io-and-expressjs/app.js var express = require("express"…

Arduinoでステッピングモータ42BYGHM809(Sparkfun)をL6470ステッピングモータドライバ(Strawberry Linux)で動かす

ステッピングモータとステッピングモータドライバは千石電商で購入した。 ・ステッピングモータ 42BYGHM809 http://www.sengoku.co.jp/mod/sgk_cart/detail.php?code=EEHD-0PK4 ・ステッピングモータドライバ L6740 http://www.sengoku.co.jp/mod/sgk_cart/d…

CoolTermにBaud rateを追加する方法

http://forums.the-meiers.org/viewtopic.php?f=4&t=479ApplicationsフォルダのCoolTermフォルダ(CoolTerm.appがある階層)に baudrates.iniというファイルを作り、追加したいBaud rateを記述する。baudrates.ini 100 110 150 128000 153600 256000 460800 …

オシロスコープのメモ

OWON PDS5022T

RepRap controller boardの比較

http://reprap.org/wiki/Comparison_of_ElectronicsArduinoで動くもの ・RAMPS、Ultimaker electronics(すべてArduino Mega w/ ATmega1280)ARM32bitを使ったもの ・4pi(SAM3U), Smoothieboard(LPC1769)ステッピングモータドライバ ・A4988、DRV8825

3Dプリンタ Portabeeの組み立てとテスト

Portabeeを組み立てた。自分の場合は届いたリミットスイッチの回路が説明書のものと異なっていて Y方向のスイッチがうまく押せなかったので Y方向のパーツを本家サイトからダウンロードしてきて再設計して3Dプリンタで作った。 方向が逆である リミットスイ…

openFrameworksでDJのターンテーブルを描く

testApp.h #pragma once #include "ofMain.h" class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed (int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, i…

Arduinoでステッピングモータのマイクロステップ駆動

ここを参考に。 http://nekosan0.bake-neko.net/connection_stepper.html #include <MsTimer2.h> volatile int iCount; void counting() { iCount++; if (iCount==960) { iCount = 0; } } void setup() { Serial.begin(9600); pinMode(6, OUTPUT); //oc0a (PD6) for X pi</mstimer2.h>…

Arduino UNOで10bit PWM

ここを参考にしてコード書いた。 http://forum.arduino.cc/index.php/topic,41964.0.html Timer1が16bitなのでこれを使えば良いと言っている。PWMはどれでも10bitモードが使えるのかな? #define ledPin 9 void setup() { /********************************…

マイコンで使うシフト演算

http://elec-studio.eco.coocan.jp/tool_soft02.html例えば次の例。 TCCR1B &= ~(1 << CS12);これはCS12のみをゼロにする(フィルターをかける)コード。CS12はビット番号を取得するグローバル変数。 (0 or 1の値と思っていたら違った) CS12は2番なので、1…

バージョン2.4.3を指定してOpenCVをMountain lionにインストールする

ここを参考に。 http://ruirui.jp/blog/2013/03/homebrewopencv-243.html $ brew versions opencv 2.4.5 git checkout 586e8b2 /usr/local/Library/Taps/homebrew-science/opencv.rb 2.4.4a git checkout 3efa797 /usr/local/Library/Taps/homebrew-science/…

MacでKinectを使う OpenNIのインストール

http://www.cyber.t.u-tokyo.ac.jp/~take/blog/kinect/install-openni-with-homebrew.htmllibusbでエラーが出たのでアンインストールしてから 再インストールした。 $ brew uninstall libusb $ brew install openni$ brew tap totakke/openni $ brew install…

node.jsでクローリングするコード

HTML取得にはrequestモジュール、パーサーにはcheerioモジュールを使う。http://liginc.co.jp/programmer/archives/4848

expressの使い方ー画像を表示するまでの最小構成

ここを参考に。 http://net.tutsplus.com/tutorials/javascript-ajax/introduction-to-express/静的リンクを持つindex.htmlを表示するまでの最小構成のHTTPサーバを書く。index.html <html> <head> <title>express</title> </head> <body> <h1>Hello, world!</h1> <img src="./image.jpg" /> </body> </html> app.js var express = require("express");…

Raspberry piのカメラモジュールでWebカメラ的なストリーミング配信する

ここの記事を参考に。 http://www.designspark.com/jpn/blog/jpn-raspberry-pi-camera-module-setupクライアントとしてはMacOSXでmplayerを動かす。 $ brew install mplayer $ nc -l 5001 | mplayer -fps 31 -cache 1024 -あとifconfigでIPアドレスを確認し…