2013年8月29日木曜日

Teraterm で 16進表示


Tera termで16進数を取得するのは以下の通り。
  1. メモ帳でTERATERM.INIを読み出す
  2. Debug行をDebug=onと書き換える
  3. Teraterm起動
  4. 「Shift+Esc」を押すごとに、
  5. 通常表示 -> デバッグモード -> 16進デバッグモード -> 非表示- > 通常表示 ->…… と 切り替わる

2013年8月1日木曜日

Grove for Arduino on the Mac


http://www.seeedstudio.com/wiki/Grove_-_Serial_LCD
ライブラリーは、 v1.1からダウンロード

違うファイルをダウンロードしていたらしく、コンパイル時にエラー。 イライラ。

ダウンロードをやり直すと、すんなりと動作した。

http://www.seeedstudio.com/wiki/index.php?title=GROVE_-_Starter_Kit_v1.1b#Grove_-_Temperature_Sensor

を参考に、温度計を作成。  

---------------------------------------
#include <SerialLCD.h>
#include <SoftwareSerial.h> //this is a must
#include <math.h>
// initialize the library
SerialLCD slcd(11,12);//this is a must, assign soft serial pins

const int tempPin = 0;

void setup() {
  // set up
  slcd.begin();
  // Print a message to the LCD.
  slcd.print("Temperature is:");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  slcd.setCursor(0, 1);
  // print the number of seconds since reset:
//  float TT = readTemp();
  SLCDprintFloat( readTemp() ,1);
  slcd.print(" Celsius");
  delay(1000);
}

void SLCDprintFloat(double number, uint8_t digits)
{
  // Handle negative numbers
  if (number < 0.0)
  {
     slcd.print('-');
     number = -number;
  }

  // Round correctly so that slcd.print(1.999, 2) prints as "2.00"
  double rounding = 0.5;
  for (uint8_t i=0; i<digits; ++i)
    rounding /= 10.0;

  number += rounding;

  // Extract the integer part of the number and print it
  unsigned long int_part = (unsigned long)number;
  float remainder = number - (float)int_part;
  slcd.print(int_part , DEC); // base DEC

  // Print the decimal point, but only if there are digits beyond
  if (digits > 0)
    slcd.print(".");

  // Extract digits from the remainder one at a time
  while (digits-- > 0)
  {
    remainder *= 10.0;
    float toPrint = float(remainder);
    slcd.print(toPrint , DEC);//base DEC
    remainder -= toPrint;
  }
}

float readTemp()
{
  const int B=3975;
  double TEMP;
  int sensorValue = analogRead( tempPin );
  float Rsensor;
  Rsensor=(float)(1023-sensorValue)*10000/sensorValue;
  TEMP=1/(log(Rsensor/10000)/B+1/298.15)-273.15;
  return TEMP;
}

------------------


このページを参考にしてます.


-------------------------------
続けざま温度・湿度計にも挑戦中。こっちは単純なアナログ値ではないので、しきい値が高い。
(やはり、アナログ値みたいですね。でもどうするんだろ?)
やっぱり違うみたいね。
http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Weather/RHT03.pdf
Output signal is  digital signal via MaxDetect 1-wire bus.
ってなんだろ。

http://wiki.openpicus.com/index.php?title=Grove_-_Temperature_and_Humidity_Sensor_Pro

サンプルのzip ファイルはなんか変。
こちらに、展開したファイルを再び圧縮したファイルを置いてみた。

ファイルの置き方については、これを参考にした。
http://hinaoka.blogspot.jp/2011/04/blog-post_21.html






2013年7月26日金曜日

Mac OSX (Mountain Lion) でのフォルダーの上書きコピー

Mac OSXではフォルダーごとコピーすると、
相手先のフォルダで同一名のフォルダを消して、新しくフォルダが作られる。

差分だけをコピーする上書きコピーではないので、注意が必要。
いちど作業すると元にもどらない。のでタチが悪い。


option を押しながら D&D.  結合を選んでコピーするとよい。


http://sitearo.com/osx/fileCopy/  が参考になった。

Oracle VM Virtual Box をインストール

iMac にOracle VM Virtual Box をインストールしてみた。

ゲストOSは、Debian をインストール中。

最小限のisoファイル(i368用)をダウンロードした(サイズは、256MB)。
Virtual Boxで、 イメージファイル(?)を設定して  実行。
インストールメディア(デフォルトはDVDドライブ)を聞いてくるので、
先ほどダウンロードしたisoファイルを指定すると、 インストール ルーチンに入るので、メッセージに従って、<はい>や <続ける>をタブとenterとスペースを使って選ぶだけ。
ネットワーク越しに、インストールを開始。

なんか、懐かしい画面が...。

CUIインストールを選んだけど、 GUIインストールを選んだ方が楽だったかも?

Y-Code の Y ってなに?

C/A code は、Coarse & Acquisition
M code は Military
P code は、Precision

じゃ, Y Code のYってなに?

うーん、調べてみたけど、分かりません。



Fritzing をインストール

Fritzing
http://fritzing.org/

Fritzing(フリッツィング) と読むらしい。


色はきれいだし、操作は簡単だし、これはイイ!

新規購入依頼品

スイッチサイエンスから購入するための注文書を作成中

1 USBケーブル USB2.0ケーブル(A-mic 5 630
2 USBケーブル USB2.0ケーブル(A-Bタイ 20 2,520
3 マイコンボードセット (Ardu Arduino Uno (最も標 2 セット 56,700
4 バニラシールド(黒) Arduino用バニラシールド基 20 12,000
5 ピンソケット Arduinoシールド用ピンソケ 20 3,600
6 温度湿度センサ GROVE - デジタル温度・湿 5 9,750
7 Grove ケーブル GROVE - 4ピンケーブル 2 760
8 Grove ケーブル GROVE - 4ピンケーブル 2 1,020
9 Grove キット GROVE - スターターバンド 1 5,070
10 Grove コネクタ GROVE - ユニバーサル4ピ 2 360

81,610円也 

選択の授業で使うよてい。 一人当たりだと約4,000円。
4年程使えれば、1人1000円/年となるので、十分に安い買い物だ。