Ciao
I would like to make a controller for my gimbal alexmos sbgc 32-bit,
with joystick Blynk move the two axes x and y (yaw and pich), there is a library for Arduino API SBGC, but I have not figured out how to fill out the sketch.
I think it’s simple, but I do not have the skills.
Can someone help;-) thanks
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SoftwareSerial.h>
#include <inttypes.h>
#include <SBGC.h>
#include <SBGC_Arduino.h>
// delay between commands, ms
#define SBGC_CMD_DELAY 20
SBGC_cmd_control_data c = { 0, 0, 0, 0, 0, 0, 0 };
/*****************************************************************************/
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "317e64a1f161476fa8b748042bd8ca55";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "saibai";
char pass[] = "Libero1104";
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
}
BLYNK_WRITE(V1) {
int x = param[0].asInt();
int y = param[1].asInt();
// Do something with x and y
Serial.print("X = ");
Serial.print(x);
Serial.print("; Y = ");
Serial.println(y);
//=========Control Setup==================================
//Initialise the Gimbal Controller
SBGC_Demo_setup();
delay(2000);
c.speedROLL = c.speedYAW = 50 * SBGC_SPEED_SCALE;
c.speedPITCH = 100 * SBGC_SPEED_SCALE;
SBGC_sendCommand(SBGC_CMD_CONTROL, &c, sizeof(c));
Serial.println("\nGimbal Control is ready");
}
void loop()
{
Blynk.run();
}