-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error: 'HERO3' was not declared in this scope #46
Comments
Hello,
Show your code in proper formattation
Il Ven 4 Ago 2023, 14:51 emccorm2 ***@***.***> ha scritto:
… Hello,
First off thank you for taking the time to create this library. I am
though running into an issue with Verifying the code. So I went back to
just the basic library and tried the example (GoProControl.ino) and get the
same error "Compilation error: 'HERO3' was not declared in this scope" I've
tried changing #define GOPRO_SSID "HERO3" in secrets.h but that didn't
work. What am I missing it's probably something simple.
—
Reply to this email directly, view it on GitHub
<#46>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBUBTW7RASK76VHWRI5T7DXTTV6ZANCNFSM6AAAAAA3EFL3MI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Please see below Error GoProControl.ino #include <GoProControl.h> /* #define CAMERA HERO3 // Change here for your camera GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA); void setup() void loop() switch (in) // Connect case 'c': case 'p': case 's':
case 'm': // DO NOT USE WHEN CAMERA IS OFF, IT FREEZE ESP // Turn on and off case 't': // Take a picture of start a video // Stop the video // Check if it is recording // Set modes case 'P': case 'M': // Change the orientation case 'D': // Change other parameters case 'F': case 'R': case 'h': case 'L': // Localize the camera case 'o': // Delete some files, be carefull! case 'g': // Print useful data // Close the connection Secrets.h #ifndef SECRETS_H // Replace the following: #endif |
If I change line 10 to #define CAMERA "HERO3" // Change here for your camera I then get error |
You aren't the first one with this error, it's a problem of how Arduino
manage the includes, I think, try
#include "GoProControl.h"
Il Ven 4 Ago 2023, 19:05 emccorm2 ***@***.***> ha scritto:
… Please see below
Error
GoProControl.ino
#include <GoProControl.h>
#include "Secrets.h"
/*
Control your GoPro with the Serial Monitor
edit the file Secrets.h with your camera netword name and password
CAMERA could be: HERO3, HERO4, HERO5, HERO6, HERO7, FUSION, HERO8, MAX
*/
#define CAMERA HERO3 // Change here for your camera
GoProControl gp(GOPRO_SSID, GOPRO_PASS, CAMERA);
void setup()
{
gp.enableDebug(&Serial);
}
void loop()
{
char in = 0;
if (Serial.available() > 0)
{
in = Serial.read();
}
switch (in)
{
default:
break;
// Connect
case 'b':
gp.begin();
break;
case 'c':
Serial.print("Connected: ");
Serial.println(gp.isConnected() == true ? "Yes" : "No");
break;
case 'p':
gp.confirmPairing();
break;
case 's':
if (CAMERA == HERO3)
{
char * statusChar;
statusChar = gp.getStatus();
Serial.println("Status :");
for(int i = 0; i < 56; i++)
{
Serial.print(statusChar[i], HEX);Serial.print(" ");
}
Serial.println("");
Serial.println("End Status.");
if (statusChar[0] == 0x00){Serial.println("camera ON");}
else{Serial.println("camera OFF");}
free(statusChar); // Don't forget to free memory
}
else
{
char * statusChar;
statusChar = gp.getStatus();
Serial.println("Status :");
Serial.println(statusChar);
free(statusChar); // Don't forget to free memory
}
break;
case 'm': // DO NOT USE WHEN CAMERA IS OFF, IT FREEZE ESP
char* medialist;
medialist = gp.getMediaList();
Serial.println("Media List:");
Serial.println(medialist);
free(medialist); // Don't forget to free memory
break;
// Turn on and off
case 'T':
gp.turnOn();
break;
case 't':
gp.turnOff();
break;
// Take a picture of start a video
case 'A':
gp.shoot();
break;
// Stop the video
case 'S':
gp.stopShoot();
break;
// Check if it is recording
case 'r':
Serial.print("Recording: ");
Serial.println(gp.isRecording() == true ? "Yes" : "No");
break;
// Set modes
case 'V':
gp.setMode(VIDEO_MODE);
break;
case 'P':
gp.setMode(PHOTO_MODE);
break;
case 'M':
gp.setMode(MULTISHOT_MODE);
break;
// Change the orientation
case 'U':
gp.setOrientation(ORIENTATION_UP);
break;
case 'D':
gp.setOrientation(ORIENTATION_DOWN);
break;
// Change other parameters
case 'f':
gp.setVideoFov(MEDIUM_FOV);
break;
case 'F':
gp.setFrameRate(FR_120);
break;
case 'R':
gp.setVideoResolution(VR_1080p);
break;
case 'h':
gp.setPhotoResolution(PR_12MP_WIDE);
break;
case 'L':
gp.setTimeLapseInterval(60);
break;
// Localize the camera
case 'O':
gp.localizationOn();
break;
case 'o':
gp.localizationOff();
break;
// Delete some files, be carefull!
case 'l':
gp.deleteLast();
break;
case 'g':
gp.deleteAll();
break;
// Print useful data
case 'd':
gp.printStatus();
break;
// Close the connection
case 'X':
gp.end();
break;
}
gp.keepAlive(); // not needed on HERO3
}
Secrets.h
#ifndef SECRETS_H
#define SECRETS_H
// Replace the following:
#define GOPRO_SSID "HERO3"
#define GOPRO_PASS "2Hx-kzr-Gfn"
#endif
—
Reply to this email directly, view it on GitHub
<#46 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBUBTTAJQJPKSBIB4V7YYTXTUTWZANCNFSM6AAAAAA3EFL3MI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Same Error Code Highlights line 12 Also Highlights lines: Do I need to adjust anything in GoProConrol.h or Settings.h ? |
Changing in GoProControl.h Unhighlighted lines 110 through 144 that were in error so maybe we are on to something. |
Hello,
First off thank you for taking the time to create this library. I am though running into an issue with Verifying the code. So I went back to just the basic library and tried the example (GoProControl.ino) and get the same error "Compilation error: 'HERO3' was not declared in this scope" I've tried changing #define GOPRO_SSID "HERO3" in secrets.h but that didn't work. What am I missing it's probably something simple.
The text was updated successfully, but these errors were encountered: