projets:openpathview:hardware:hack_gopro
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
projets:openpathview:hardware:hack_gopro [2014/12/21 15:24] – [Préparation de l'EEPROM] benvii | projets:openpathview:hardware:hack_gopro [2024/04/16 22:28] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Le hack des Go Pro Hero 2 ====== | ||
+ | ====== Câble de synchronisation des GoPro ====== | ||
+ | |||
+ | //Retour à la page principale -> [[projets: | ||
+ | |||
+ | ===== Problématique ===== | ||
+ | |||
+ | Nous devons pouvoir lancé la prise de vue sur tout les appareil en "même temps" bien sûr il est impossible de le faire exactement au même moment mais nous devons limiter le décalage entre 2 prises de vues. | ||
+ | |||
+ | ===== Solution ===== | ||
+ | |||
+ | GoPro a sorti un kit 3D, dans lequel on trouve 2 petits boîtiers rouges. Ces boîtiers sont la clé pour synchroniser 2 appareils. | ||
+ | |||
+ | La communauté d' | ||
+ | |||
+ | Nous allons donc reproduire le circuit. | ||
+ | |||
+ | ===== Ressources ===== | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | ===== Matériel pour les tests ===== | ||
+ | * Connecteurs " | ||
+ | * 2 [[http:// | ||
+ | * 2 supports | ||
+ | * des cables :) | ||
+ | * Nous utlisons des EEPROM CMS. Le datasheet est disponible à cette adresse : [[http:// | ||
+ | ===== Préparation de l' | ||
+ | |||
+ | <code C> | ||
+ | #if defined(ARDUINO) && ARDUINO >= 100 | ||
+ | #include " | ||
+ | # | ||
+ | #include " | ||
+ | # | ||
+ | #include < | ||
+ | |||
+ | #define ADDRESS 0x50 | ||
+ | |||
+ | void setup() | ||
+ | { | ||
+ | Wire.begin(); | ||
+ | |||
+ | /* Serial output */ | ||
+ | Serial.begin(9600); | ||
+ | delay(5000); | ||
+ | |||
+ | Serial.println(" | ||
+ | dump(); | ||
+ | |||
+ | Serial.println(" | ||
+ | Wire.beginTransmission(ADDRESS); | ||
+ | Wire.write(0); | ||
+ | Wire.write((byte)0x05); | ||
+ | Wire.endTransmission(); | ||
+ | |||
+ | Serial.println(" | ||
+ | dump(); | ||
+ | |||
+ | Serial.println(" | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | } | ||
+ | |||
+ | void dump() | ||
+ | { | ||
+ | Wire.beginTransmission(ADDRESS); | ||
+ | Wire.write(0); | ||
+ | Wire.endTransmission(); | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | for (int j=0; j < 8; j++) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | void printInt(int i) | ||
+ | { | ||
+ | Serial.print(" | ||
+ | |||
+ | if ( i<16 ) | ||
+ | Serial.print(" | ||
+ | |||
+ | Serial.print(i, | ||
+ | } | ||
+ | </ | ||
+ | {{: | ||
+ | Le montage correspondant : \\ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Sources ===== | ||
+ | Hack GoPro Hero 2 : [[http:// | ||
+ | |||
+ | |||
+ | La GoPro fonctionnant en 3,3v, il faut éviter d' | ||
+ | |||
+ | **Contrôle d'une GoPro par un Arduino** | ||
+ | {{ : | ||
+ | |||
+ | **Code Arduino contrôlant 6 GoPro** | ||
+ | |||
+ | <code c++> | ||
+ | //GoPro Arduino control | ||
+ | #define GOPRO_TRIG | ||
+ | #define GOPRO_ID1 | ||
+ | #define GOPRO_ID2 | ||
+ | #define GOPRO_ID3 | ||
+ | #define POW_MOD_1 | ||
+ | #define POW_MOD_2 | ||
+ | #define TIME_OUT | ||
+ | |||
+ | void GoPro_powerOn(){ | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | | ||
+ | delay(350); | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | delay(4500); | ||
+ | Serial.println(" | ||
+ | } | ||
+ | |||
+ | void GoPro_setMode(){ | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | | ||
+ | delay(350); | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | delay(350); //Security time | ||
+ | Serial.println(" | ||
+ | } | ||
+ | |||
+ | |||
+ | void GoPro_powerOff(){ | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | delay(3000); | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | Serial.println(" | ||
+ | } | ||
+ | |||
+ | |||
+ | void GoPro_takePic(){ | ||
+ | | ||
+ | int pinList[] = GOPRO_ID1; //get the pin list | ||
+ | int start_n[6]; | ||
+ | for (int i = 0; | ||
+ | start_n[i] = digitalRead(pinList[i]); | ||
+ | } | ||
+ | |||
+ | digitalWrite(GOPRO_ID2, | ||
+ | delayMicroseconds(340); | ||
+ | digitalWrite(GOPRO_ID2, | ||
+ | Serial.println(" | ||
+ | unsigned long time = millis(); | ||
+ | bool notOkList[6]; | ||
+ | int notOk = 1; //check if all statu are differente == ready | ||
+ | while (notOk==1){ | ||
+ | notOk = 0; | ||
+ | for (int i = 0; | ||
+ | if(digitalRead(pinList[i]) == start_n[i]){ | ||
+ | notOk = 1; | ||
+ | notOkList[i]=1; | ||
+ | } | ||
+ | else{ | ||
+ | notOkList[i]=0; | ||
+ | } | ||
+ | if( (millis()-time)> | ||
+ | Serial.println(" | ||
+ | for (int i = 0; | ||
+ | Serial.println("" | ||
+ | notOk = -1; | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | Serial.println(" | ||
+ | digitalWrite(GOPRO_TRIG, | ||
+ | delayMicroseconds(340); | ||
+ | digitalWrite(GOPRO_TRIG, | ||
+ | Serial.println(" | ||
+ | } | ||
+ | |||
+ | void setup() { | ||
+ | // Serial output | ||
+ | // Serial.begin(38400); | ||
+ | |||
+ | pinMode(POW_MOD_1, | ||
+ | digitalWrite(POW_MOD_1, | ||
+ | | ||
+ | pinMode(POW_MOD_2, | ||
+ | digitalWrite(POW_MOD_2, | ||
+ | | ||
+ | Serial.begin(9600); | ||
+ | Serial.println(" | ||
+ | | ||
+ | int pinList[] = GOPRO_ID1; | ||
+ | for (int i = 0; | ||
+ | pinMode(pinList[i], | ||
+ | } | ||
+ | | ||
+ | | ||
+ | pinMode(GOPRO_ID2, | ||
+ | pinMode(GOPRO_ID3, | ||
+ | pinMode(GOPRO_TRIG, | ||
+ | // 1 photo taken | ||
+ | | ||
+ | // Set output lines to their default state | ||
+ | digitalWrite(GOPRO_TRIG, | ||
+ | digitalWrite(GOPRO_ID2, | ||
+ | digitalWrite(GOPRO_ID3, | ||
+ | | ||
+ | /* Serial.println(" | ||
+ | while (Serial.available() == 0) {} | ||
+ | Serial.read(); | ||
+ | */ | ||
+ | // ID3 High to say we are going to control the camera, set this low when finished controlling the camera | ||
+ | digitalWrite(GOPRO_ID3, | ||
+ | | ||
+ | delay(1500); | ||
+ | // Serial.println(" | ||
+ | | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | |||
+ | int availableData = 0; | ||
+ | char lastChar; | ||
+ | if (Serial.available()> | ||
+ | availableData = Serial.available(); | ||
+ | for (int i = 0; i< | ||
+ | lastChar = Serial.read(); | ||
+ | } | ||
+ | if (lastChar == ' | ||
+ | GoPro_powerOn(); | ||
+ | } | ||
+ | else if(lastChar == ' | ||
+ | GoPro_powerOff(); | ||
+ | } | ||
+ | else if(lastChar == ' | ||
+ | GoPro_takePic(); | ||
+ | } | ||
+ | else if(lastChar == ' | ||
+ | GoPro_setMode(); | ||
+ | } | ||
+ | else{ | ||
+ | Serial.println(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |