接続例 サンプルコード #define INAPIN (7) #define INBPIN (6) #define VOLUMEPIN (0) // 真理値表 // IN │ φ : φ~ // ──┼──┼── // LOW│ LOW: HIGH // ──┼──┼── // HIGH│HIGH: LOW #define BASESTEPANGLE (1.0) // 基本ステップ角度:1ステップで動く角度 void setup() { pinMode(INAPIN, OUTPUT); pinMode(INBPIN, OUTPUT); Serial.begin(9600); } void step_forward( int iRpm ) { // ・1ステップにかけるべき時間は、 // (基本ステップ角度) * (rpmから求まる1度うごくのにかける時間) // ・rpmから求まる1度う
モータードライバTA7774PはMOSFETアレイではなくバイポーラトランジスタアレイなので、PWMで出力電圧を制御できるのか、と思ったので実験する。 実験用のコード int STAND_BY = 2; int _PWM = 3; int quarter = 1023/4; void setup(){ pinMode(STAND_BY,OUTPUT); pinMode(_PWM,OUTPUT); digitalWrite(STAND_BY,HIGH); } void loop(){ analogWrite(_PWM,quarter); delay(2000); analogWrite(_PWM,quarter*2); delay(2000); analogWrite(_PWM,quarter*3); delay(2000); analogWrite(_PWM,quarter*4); del
最近ステッピングモーターというものを知りました。モーターなんですが、パルスを与えるたびにステップ(モーターによって違う)分だけ回転するというものです。そんなもんサーボにも出来るじゃないか、と思うかもしれませんが、基本的にサーボは180度ぐらいしか動きません。ステッピングモーターは角度を覚えていない変わりに、現時点からの回転量を細かく指示することができるものです。 作ったもの ステッピングモーターについて 動作は非常に単純。コイルに電流を流してその電磁力で回転するというだけです。 ステッピングモータの仕組みと制御のコツ マイコン搭載ロボット製作入門 第7章 ステッピングモーターを動かしてみよう Arduinoでステッピングモーターを動かしてみる 下記を参考にさせて頂きました。こちらは可変抵抗の値に応じて回転速度を変更するものです。ただし、自分がやりたいのは指定した度数だけ回転するものなので、
背景 私は植物を育てると大体枯らしてしまう。でもベランダで野菜を育てたい。 といわけで土壌湿度センサーを利用し、乾燥したら水を勝手にやってくれる機械を作ることにした。 利点 ベランダでは重量の問題からあまり土を厚く敷くことができないため、枯れるリスクと栄養不足のリスクが高い。しかし、水やり器で液体肥料を撒くことで、土壌が薄くてもちゃんとした野菜ができる(といいなぁと思っている。) 全体構成 今回は水道から水を引く形ではなく、水を溜めたタンクからポンプを使い水をまく形とする 全体像は以下の通り。 土壌湿度センサで土壌湿度を計測 Arduinoで、センサの値が一定以下になったら信号を送る Arduinoから信号がきたら、スイッチ(リレー)を入れる スイッチが入ると、灯油ポンプが動いて水をくみ上げる 材料 電池式灯油ポンプ 500円くらい 自動で止まらないやつの方がよい Arduino (自分は
DigiFa部WS第2弾はレーザー加工機で作るArduinoケースです!(全2回) (ちなみに第1弾はこちら) 今回はArduinoケースを作る課程で、レーザー加工機の基本的な使い方やデータの作成方法、平面から立体を作るという事を学んで貰えればとおもいます。レーザーで切り出したものを組み合わせるだけでなく、ネジやナットなどの既成のパーツを組み合わせることでものづくりの幅を広げて貰えれば幸いです! さて、具体的に制作方法は前回の記事に記載しているので、今回のWSでは記事の補足と、実際に世に出ているレーザー加工機でのケース作成事例を取り上げてみることにしました。 オーソドックスなArduinoケースである[プロジェクトボックス for Arduino]です。アクリルの組み合わせにネジ止めをして、接着をせずにケースを作っています。トップ、サイドにスリットが空いており、ケースに入れたままプロトタイ
名称 if(Serial) 説明 指定したシリアルポートが利用可能かを示す。 Native USBポートを持つボードでは、if(Serial) (Dueの場合は、if(SerialUSB))は、USB CDCシリアル通信接続がオープンされているかどうかを示す。他の全てのボードと、USB CDCではないポートでは、いつもtrueを返す。 これは、Arduino 1.0.1で導入された。 書式 if (Serial) 引数 なし。 戻り値 指定したシリアルポートが利用可能であればtrue。LeonardoのUSB CDC接続が利用可能になる前だけfalseを返す。 使用例 void setup() { //Initialize serial and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait fo
Arduino Leonardoへのガイド Arduino Leonardoをパソコンに接続するには、マイクロUSBのB端子を持つケーブルが必要です。このUSBケーブルで、電源を供給し、データ通信を行います。Leonardoにスケッチを書き込むには、Arduino IDEの「ツール」→「マイコンボード」メニューから「Arduino Leonardo」を選んでください。 Arduino Unoとの違い 基本的には、Leonardoは他のArduinoマイコンボードと全く同じように使えます。しかし、少数ながら重要な違いがあります。 1個のマイコンでスケッチの実行およびUSB通信の両方を実現している Leonardoは、1個のマイコンでスケッチを動かし、USB通信も行なっているという点が、これまでのArduioマイコンボードと異なります。Unoおよびその他のマイコンボードでは、これら二つの機能の
Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post MsTimer2 is a small and very easy to use library to interface Timer2 with humans. It's called MsTimer2 because it "hardcodes" a resolution of 1 millisecond on timer2. Updated again: a new version is available here UPDATED: works on ATmega1280 (thanks to Manuel Negri). works on ATmega328 (than
■ ArduinoをShieldで遊ぼう 前回、 2009年現在のArduino について書いた。今、どのArduinoを買えばいいのか的な話ですな。今回はもう一歩進んで、Arduinoをイジり始めたら、とりあえずどう遊ぶと楽しめるかについて触れてみたい。 AVRマイクロコントローラを搭載したマイコンボード、Arduino Duemilanove(アルドゥイーノ デュエミラノーヴェ)。PCとUSB接続し、専用のArduino IDE(開発環境)を使えば、比較的に容易にプログラムできる Arduino用のShield(シールド)。Arduinoの機能を拡張し、より高度な動作を容易に実現させるためのドーターボードだ。写真はWave Shield ArduinoとShieldを組み合わせて作った楽器。ボタンを押すとPCMサウンドが炸裂するゼ~!! みたいな。Shieldを使えばこういった少々ムツ
Arduino/Make/フィジカルコンピューティング/電子工作あたりで活動しています。スタバの空きカップを使ったスタバカップアンプなど製作。最近はもっぱらArduinoと3Dプリンタの自作に興味があります。 Arduinoとエレクトレット・コンデンサ・マイクを使ってオーディオレベルメータを作ってみた。マイクで拾った音の大きさに応じて、LED8個を段階的に点灯させている。 エレクトレット・コンデンサ・マイク(以下ECM)は音の強弱により容量が変わる一種のコンデンサだ。ECMから音声信号を取り出すためには+極に電圧をかけ、その電圧をコンデンサを介して取り出す。音の強弱によりECMの容量が変化し、充放電することで電圧の変化となり、それが音声信号となる。 ECMの音声信号はとても小さく、そのままArduinoに入力してもノイズと区別がつかない。そんな時はOPアンプを使う。小さな信号を大きな信号に
node.jsとArduinoを繋いでドーン!!! arduinodeを公開しました(旧名:Node-Arduino-General-IO) もうArduinoのプログラミングはしなくてイイ! node.jsだけ。 node.jsだけでプログラミング出来るんだ!!! [2013/04/07] v0.0.4に合わせてサンプルコードを編集 [2013/04/15] v0.0.6にアップデート。Stream API追加。こちらの記事を参照して下さい。 [2013/05/05] リポジトリ名を変更。記事中のURLも変更した。 [2013/05/05] v0.0.7にアップデート。こちらの記事を参照して下さい。 [2013/07/04] v0.0.8にアップデート。こちらの記事を参照して下さい。 [2013/12/27] v0.9.0にアップデート。こちらの記事を参照して下さい。 最近、Ardui
大阪てら子番外編「お菓子でもつまみながら Max/MSP/Jitter とかをいじる会」てのに行ってきたんで、勉強がてらMax/MSP+ArduinoでLEDオーディオレベルメーターを作ってきたよ。 ほい。自分も含めて初心者の多いゆるゆるなMax/MSP会だったんだけど、流れ的にGainerとかArduinoが出てきたんで、一応持ってたArduinoを取り出してそっちにシフト、なんか光らせようとぱちぽち。とりあえず繋がってLEDがピコピコなりはじめたところでタイムアップ。帰って補習。 作ってたのはベタにLEDオーディオレベルメーター。マイクから音のレベル拾って、8段階にマッピングして、デジタルピンに出力。んで、できたのはこれ。ドライバ部分がなんか不細工だけど、まーいいや。 Max/MSP×Arduino ご利用は計画的に Max/MSPとArduinoを通信させるにはいくつかの方法があるみ
接続例 ※LCDシールドに関する接続は省略 サンプルコード #include <LiquidCrystal.h> #define SENSORPIN (0) LiquidCrystal g_lcd( 12, 11, 5, 4, 3, 2 ); void setup() { g_lcd.begin( 16, 2 ); g_lcd.clear(); } void loop() { int iValue = analogRead( SENSORPIN ); double dV = iValue * 5.0 / 1023; double dR = -1.0; if( 0.005 < (5.0 - dV) ) { dR = 10 * 1000 * dV / (5.0 - dV); } g_lcd.clear(); g_lcd.setCursor( 0, 0 ); g_lcd.print( dV );
[HOME] [Processing関係] [Arduino関係] [マテリアル関係] [秋葉原工作マップ] 2008年用ですが、部分的に内容を更新しています(2010/06/14)。 また、[建築農業工作ゼミ2009-2010]とも連動していますので、そちらにも幾つかサンプルがあります。 : 以前、ワイヤレス通信としてXbeeモジュールを用いましたが、もう一つワイヤレス通信として「BlueTooth」を用いる方法があります。今回は、SparkfunのBlueToothモジュール「BlueSmiRF Gold」を使います(国内ではストロベリーリナックスで販売)。Xbeeは3.3V電源を使用しますが、「BlueSmiRF Gold」は3.3V〜6.0Vまでの電源を使うことができるので、そのままArduinoにも接続しやすい仕様となっています(ただし、日本において、「BlueSmiRF
ちびでぃ~の は、ブレッドボード上のArduino実験・試作環境です。 「安くてちっちゃい」Arduino環境をめざしてます ・Metaboardベース、ソフトウエアUSBでPCに接続 ・ブレッドボード実装で、はんだづけは最小限に ・めたぼ~どから、動作に必要な最低限の構成までダイエット(基板、コネクタを排除) ちびでぃ~の部品セット 送料込み700円で頒布いたします。 回路はめたぼ~どと同じで、コネクターは取り払われています。 ●標準のArduino環境と較べて優れている事 ・安い ・ブレッドボード付 ・USBインターフェース付 ●安くするために犠牲にした事 ・ブレッドボードなので、堅牢性が劣る、シールドはささらない ->実験以外では、めたぼ~ど などを使ってください。 ・電源は、USBコネクタだけ ->外部USB電源使ってください。 ・シリアルポートが無し、シリアルデバッグできない -
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く