先週聞こえなかった部分は今週復習をかねて。。。
今週放送予定の資料をアップしておきます。
毎週土曜21:00~24:00位まで?週刊Android
Android、Arduino ソフト~ハードまで、IT関連情報、スポーツ(モトクロス等)、海外ドラマ(洋限定)など、
すき放題、やっちゃいますw
twitter:@weeklyandroidjp
USTREAM:http://p.tl/zY22
ニュース(9月):http://p.tl/Qylq
月刊Android SNS: http://p.tl/4HTR
↑↑↑↑↑↑↑↑↑↑↑↑↑↑
このアタリのURLは毎週変更になる意可能性があります。
今週は、「夜はハードに」Vol8です。
・ロギングできるように、microSDカードシールドを作成
・以前使用した距離センサーをアナログ入力ポートに接続しメモリに書き込む。
1.電源の回路図
なんだかんだで降圧回路も必用ない。。。
006P(四角い乾電池)をそのままDCジャックに
ぶち込んでOKです。(そもそも入力電圧6.0V~なんですよ)
orzまた訂正。。。
でも、今後使えるからいいっか。。。
3.3V端子の最大定格は50mAなので、3.3Vの電源を作るのに使えますね。
ほーよかったw
C12はタンタルの他にコンデンサを入れないといけないかもしれないです。

2.Aruduino+LCD+GPS+microSD
まだ、接続してないですよw
2.1.Aruduino+LCD+GPS+microSD
2.2.LCDシールド
2.3.microSDシールド
TC74HC541APでは動作確認ができませんでしたので、
抵抗で分圧した回路図を上げておきます。
どうも、541は結構な電流を消費するようだというところまでしかわかりませんでした。orz
データシート(TC74HC541AP):http://p.tl/I9ul
抵抗で分圧した動く回路図をアップしました。
3.距離センサーをSDカードに書きます。
殆どサンプルのままですよ。。
/*
SD card datalogger
This example shows how to log data from three analog sensors
to an SD card using the SD library.
The circuit:
* analog sensors on analog ins 0, 1, and 2
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 10
created 24 Nov 2010
updated 2 Dec 2010
by Tom Igoe
This example code is in the public domain.
*/
#include <SD.h>
// On the Ethernet Shield, CS is pin 4. Note that even if it's not
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
// 53 on the Mega) must be left as an output or the SD library
// functions will not work.
const int chipSelect = 10;
void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
// output, even if you don't use it:
pinMode(10, OUTPUT);
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Serial.println("card initialized.");
}
void loop()
{
// make a string for assembling the data to log:
String dataString = "";
// read three sensors and append to the string:
for (int analogPin = 0; analogPin < 1; analogPin++) {
int sensor = analogRead(analogPin);
dataString += String(sensor);
if (analogPin < 2) {
dataString += ",";
}
}
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
File dataFile = SD.open("datalog.txt", FILE_WRITE);
// if the file is available, write to it:
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
// print to the serial port too:
Serial.println(dataString);
}
// if the file isn't open, pop up an error:
else {
Serial.println("error opening datalog.txt");
}
}