iアプリのカメラリモコンといったら、SILKYPIX リモコンQRが有名だけど、最近、起動するのに携帯電話の時間を過去にずらさないと使えなくなっちゃったからね。

本当は公開したいところだけど、恒久的に使用できるホームページスペース持ってないので、むりっぽ。
とりあえず、リモートコントローラーFを忘れても、撮影できるのがうれしいかな。
便利便利。
気が向いたら更新なダラダラブログ

import com.nttdocomo.device.*;
import com.nttdocomo.ui.*;
public class RemoteTest2 extends IApplication {
int freq = 38; // KHz
int base = 1000; // usec
IrRemoteControl irc;
public void start() {
irc = IrRemoteControl.getIrRemoteControl();
Dialog dia = new Dialog(Dialog.BUTTON_OK, "IRリモコンテスト");
try {
dia.setText("送信します\n");
dia.show();
irc.setCarrier(5000/freq, 5000/freq ); //一般的なキャリア
//0:High=1ms,Low=1ms
irc.setCode0(IrRemoteControl.PATTERN_HL, base*1, base*1);
//1:High=3ms,Low=3ms
irc.setCode1(IrRemoteControl.PATTERN_HL, base*3, base*3);
//開始フレーム
IrRemoteControlFrame frame1 = new IrRemoteControlFrame();
frame1.setFrameData(new byte[]{(byte)0x80}, 8);
frame1.setStartHighDuration(base*10); //スタートは10ms
frame1.setStartLowDuration(0); //1とあわせて13ms+3ms
frame1.setStopHighDuration(0); //ストップパルスは使わない
frame1.setFrameDuration(450 * 10); //フレーム長(0.1ms)
frame1.setRepeatCount(1);
//レリーズ用パルスフレーム
IrRemoteControlFrame frame2 = new IrRemoteControlFrame();
frame2.setFrameData(new byte[]{(byte)0x0}, 0);
frame2.setStartHighDuration(base*4); //4msパルス
frame2.setStartLowDuration(0);
frame2.setStopHighDuration(0);
frame2.setFrameDuration(250 * 10);
frame2.setRepeatCount(IrRemoteControlFrame.COUNT_INFINITE);
IrRemoteControlFrame[] ircf =
new IrRemoteControlFrame[] {frame1,frame2};
irc.send(ircf.length, ircf, 30); //送信
Thread.sleep(3000); //3秒間
irc.stop();
dia.setText("送信しました\n");
dia.show();
} catch (Exception e) {
dia.setText("エラー"+ e.getMessage());
dia.show();
}
this.terminate();
return;
}
}



import java.io.*;
import java.util.*;
import com.nttdocomo.device.*;
import com.nttdocomo.ui.*;
public class RemoteTest extends IApplication {
int freq = 38; // KHz
int base = 1000; // usec
boolean status = false;
IrRemoteControl irc;
public void start() {
irc = IrRemoteControl.getIrRemoteControl();
byte[] datas = createData("11111100");
Dialog dia = new Dialog(Dialog.BUTTON_OK, "IRリモコンテスト");
try {
dia.setText("送信します\n");
dia.show();
send(datas);
Thread.sleep(10000);
dia.setText("送信しました\n");
dia.show();
} catch (Exception e) {
dia.setText("エラー"+ e.getMessage());
dia.show();
}
this.terminate();
return;
}
public byte[] createData(String source) {
int len = source.length() % 8;
if(len>0) {
source += "00000000".substring(0,8-len);
}
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
for(int i=0; i < source.length() ; i+=8 ) {
int buf = Integer.parseInt( source.substring(i,i+8), 2 );
out.write(buf);
}
out.close();
return out.toByteArray();
} catch(Exception e) {
return new byte[0];
}
}
public void send(byte[] data) {
irc.setCarrier(10000 / freq / 2, 10000 / freq / 2);
irc.setCode0(IrRemoteControl.PATTERN_HL, base * 1, base * 4);
irc.setCode1(IrRemoteControl.PATTERN_HL, base * 1, base * 1);
IrRemoteControlFrame frame1 = new IrRemoteControlFrame();
frame1.setFrameData(data, data.length * 8);
frame1.setStartHighDuration(base*10);
frame1.setStartLowDuration(base*3);
frame1.setStopHighDuration(0);
frame1.setFrameDuration(470 * 10);
frame1.setRepeatCount(1);
IrRemoteControlFrame[] ircf = new IrRemoteControlFrame[] {frame1};
irc.send(1, ircf);
status = true;
return;
}
}





と、いうわけで、今日は諏訪大社付近の銭湯まで、足を伸ばしてみました。

割と大きめ。
どっちが本体?な感じ。