Last active
January 2, 2016 22:19
-
-
Save loveandsheep/8369022 to your computer and use it in GitHub Desktop.
oFでThetaのシャッターを切る簡単なサンプル。
アドオンのofxNetworkにあるofxTCPClientが必要です。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ofxSimpleTheta.h | |
// ofxSimpleTheta | |
// | |
// Created by Ovis aries on 2014/01/11. | |
// | |
// | |
#ifndef ofxSimpleTheta_ofxSimpleTheta_h | |
#define ofxSimpleTheta_ofxSimpleTheta_h | |
#include "ofMain.h" | |
#include "ofxTCPClient.h" | |
const char smplTheta_com_init[] = { 0x1C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, | |
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | |
0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00}; | |
const char smplTheta_com_opener[] = { 0x16, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, | |
0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, | |
0x00, 0x00 }; | |
const char smplTheta_com_capt[] = { 0x1A, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, | |
0x00, 0x00, 0x0E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | |
class ofxSimpleTheta{ | |
private: | |
ofxTCPClient client; | |
public: | |
void setup(){ | |
client.setup("192.168.1.1",15740); | |
client.sendRawBytes(smplTheta_com_init, 28); | |
client.sendRawBytes(smplTheta_com_opener, 22); | |
} | |
void capture(){ | |
client.sendRawBytes(smplTheta_com_capt, 26); | |
} | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment