2015年2月8日日曜日

8pino アナログ入力 The 8pino input an analog signal.

順番は逆になってしまいましたが、8pinoへのハンダ付けとアナログ入力のテストの記録です。
I soldered pins for the 8pino.
And, I experimented on the 8pino analog input.


1.ハンダ付け Soldering 
まずは、ピンヘッダーのハンダ付け。
手元にダブルのピンヘッダーしかなかったので、ピンヘッダーを1列ずつ切り取り、横に並べて使う事にしました。

A method to solder pins to the 8pino.
I have only double lines of pins.
I cut it and arranged it to one line.

ブレッドボードに並べます。
I attached it to a breadboard.

8pinoを乗せて、この状態でハンダ付けをします。
I soldered it after I attached the 8pino.

出来上がり。
Finish.

2.ブレッドボードに取り付け Wirering.
ブレッドボードに8pinoと可変抵抗器を取り付けます。
念のために、心配な人は可変抵抗器の前に抵抗を入れておきます。
I attached the 8pino and variable register to a breadboard.

3.スケッチ Sketch and run.
Lチカスケッチを改造します。
アナログ入力を使う時は、pinmodeはデフォルトのままにしておくのがArduino流のようです。
Prease remodel the LED-Blinking program.
As for the pin mode, analog input is possible as a default what Arduino style.

// Lチカ2 Brinking the LED 2
// ボリュームに応じてLチカのタイミングを変える。 Change timing for brinking LED with analog volume. 

int led = 1;  // On board LED (pin 1)
int vol = 1;  // Analog input 1(pin 2)
int vol_num;  // Analog value

void setup() {
  pinMode(led, OUTPUT);
  //pinMode(vol, INPUT); //Default pin mode is analog input.
}

void loop() {
  vol_num = analogRead(vol);  //Read analog data (0 to 1024)
  digitalWrite(led, HIGH);    // turn the LED on
  delay(vol_num);             // wait
  digitalWrite(led, LOW);     // turn the LED off
  delay(vol_num);             // wait
}

ボリューム最大値 = 1.9sec
Maximum voltage. The period time is 1.9sec.

ボリューム最小値 = 251.2us
Minimum voltage. The period time is 251.2usec.
Evernote はあなたがすべてを記憶し、手間をかけずに整理できるようにお手伝いします。Evernote をダウンロードする

20150208 運転免許証の更新 Renewing of the driver’s license.

運転免許の更新を中南信運転免許センターで行ってきました。
受付時間は8:30からです。いつも混み合うので早めに(8:10)行ったのですが、既に200人以上の人で混み合っていました。
職員さんによると、日曜日の午前中は特に混み合うので、午後に来てほしいとのことでした。でも、みんな面倒くさい事は午前中に済ませたいんだよね。それよりも土曜日やってもらえれば分散できるんだけどな。
私は、一応、無事故無違反の優良ドライバーのカテゴリでしたが、それでも一時間半、かかりました。
次(5年後)はもっと早く来よう。

I had my driver's license renewed at CHUNANSHIN driver's license center.
The receiption was from 8:30, but I arrived at 8:10.
Though it was early time of the morning, there was crowded.
According to the staff, it seems to be crowed on the mining of Sunday.
I am an excellent driver, but the time to renew a driver's license was one and half hours.
At the time of next renewing, I intend to leave the house earlier.

安協の会費は2000円も掛かりますが、地元の役員の事もあるから仕方なく入ります。
The fee of the Association of road safety is 2,000 yen.




Evernote はあなたがすべてを記憶し、手間をかけずに整理できるようにお手伝いします。Evernote をダウンロードする

Macでmbedにドラッグアンドドロップできない。 Cannot drag and drop to mbed on Mac

Macでmbedへドラッグアンドドロップできない時のTips。
Tips copy file from mac to mbed.

Macでは、mbedボードへのDrag and Dropが失敗する事が多いようです。
ターミナルに以下のコマンドを打ち込む事で、ファイルがコピーされます。
In Mac,Drag and Drop to mbed board seems to often fail.
Please input the following commands to solve the problem.

ボリューム名、ファイル名は、環境によって異なります。
デスクトップからターミナルにDrag and Dropする事で自動的に入力可能です。
Following "VOLUME_NAME" and "FILE_PATH/FILE_NAME.BIN" varies according to your environment.
Perform drag and drop of it from a desktop to the terminal.It is input automatically.

  1. マウント Mount of the volume.
    sudo mount -u -w -o sync VOLUME_NAME
  2. ファイルの消去 Remove "mbed.htm" file.
    rm VOLUME_NAME/mbed.htm
  3. ファイルのコピー Copy file.
    cp -X FILE_PATH/FILE_NAME.bin VOLUME_NAME 
参考サイト
Evernote はあなたがすべてを記憶し、手間をかけずに整理できるようにお手伝いします。Evernote をダウンロードする