Saturday, June 25, 2011

EP121のACアダプタ修理

うっかりEP121を落としたらプラグが割れてしまったので、とりあえず何とか対処してみました。
まずは共立エレショップDCプラグの注文。内径1.1φ、外径3.0φ。
ただDC12V/0.5Aなのがかなり心配。19Vの3.0Aをフルに通すことは無くても、発熱とかしないといいけど…


ジャンクに19.5Vがなかったので、19Vでも多分大丈夫だろうと確保。ジャンクのくせに高い。

被覆を剥いて適当にはんだ付け。

今のところ動作に問題なし。

Friday, June 10, 2011

JPEGカメラ

スイッチ・サイエンスLinkSpriteシリアル接続JPEGカラーカメラを動作テスト。

とりあえず何も考えずにシリアルに出力して、それをそのまま保存してみる。


一応撮影はできるみたいだけど、やっぱり転送速度が遅い。
9600bpsだから仕方ないんだけどね。

撮影はArduinoで下のようなプログラムを使ってテスト。
リセットボタンを押すと吐き出されてくるバイナリを、そのままシリアルコンソールで保存しただけ。
ひとまず使えることは確認できた。

/*
JPEG Camera Example Sketch

Hardware Notes:
The camera Rx/Tx should be attached to pins 2 and 3.
IMPORTANT: The JPEG camera requires a TTL level shifter between the camera output
and the arduino. Bypassing this may damage the Arduino pins.
*/

#include <JPEGCamera.h>
#include <NewSoftSerial.h>

JPEGCamera camera;

char response[32];
unsigned int count=0;
int size=0;
int address=0;
int eof=0;

void setup()
{
//Setup the camera, serial port
camera.begin();
Serial.begin(9600);

//Reset the camera
count=camera.reset(response);
delay(3000);

//Take a picture
count=camera.takePicture(response);

//Get the size of the picture
count = camera.getSize(response, &size);

while(address < size)
{
//Read the data starting at the current address.
count=camera.readData(response, address);
//Store all of the data that we read to the SD card
for(int i=0; i //Check the response for the eof indicator (0xFF, 0xD9). If we find it, set the eof flag
if((response[i] == (char)0xD9) && (response[i-1]==(char)0xFF))eof=1;
Serial.print(response[i], BYTE);
//If we found the eof character, get out of this loop and stop reading data
if(eof==1)break;
}
//Increment the current address by the number of bytes we read
address+=count;
//Make sure we stop reading data if the eof flag is set.
if(eof==1)break;
}
}

void loop()
{

}

さて、次の目標はと…