mjs513
Senior Member+
Know this is not a real Teensy issue but I am completely stumped on this one. Just a little background - I am making a homebrew pseudo-autopilot using a T3.5 and working on implementing Mavlink protocol interfacing to APM Planner using a ESP8266. Its actually working decently - I am able to transmit IMU and GPS messages to the ground station gui and can even receive joystick commands through the ground station to the autopilot.
Ok so here's my problem, I am trying to set it up so I can modify parameters from the GUI and so I am trying to create a structure array to hold what I need to set the parameters but I keep running into errors on the structure. I tried googling and think I am doing it right but I know I am missing something so any help would be appreciated. Here is the code and the error message:
Error:
I have tried variations on a theme but just gives me the same or similar errors.
Thanks
Mike
Ok so here's my problem, I am trying to set it up so I can modify parameters from the GUI and so I am trying to create a structure array to hold what I need to set the parameters but I keep running into errors on the structure. I tried googling and think I am doing it right but I know I am missing something so any help would be appreciated. Here is the code and the error message:
Code:
struct local_param_set
{
char param_id[16]; ///< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
uint8_t param_type; ///< Onboard parameter type: see the MAV_PARAM_TYPE enum for supported data types.
float param_value; ///< Onboard parameter value
};
struct mavlink_param_set local_param[4] =
{
{"ARMING_REQUIRE" , MAV_PARAM_TYPE_UINT8 , 0 },
{"INITIAL_MODE" , MAV_PARAM_TYPE_UINT8 , 0 },
{"ARMING_CHECK" , MAV_PARAM_TYPE_UINT8 , 0 },
{"CRUISE_SPEED" , MAV_PARAM_TYPE_FLOAT, 2.0 }
};
Error:
Code:
sMavlink.h:39: error: 'local_param' does not name a type
local_param[] =
^
'local_param' does not name a type
I have tried variations on a theme but just gives me the same or similar errors.
Thanks
Mike