<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — PlatformIO error 'remotexy' not declared in this scope]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1647&amp;type=atom" />
	<updated>2023-04-14T11:28:19Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1647</id>
		<entry>
			<title type="html"><![CDATA[Re: PlatformIO error 'remotexy' not declared in this scope]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5103#p5103" />
			<content type="html"><![CDATA[<p>Ok, i figured it out. What a dumb mistake this was.</p><p>I had to change the order of the occurance of these two lines from<br /></p><div class="codebox"><pre><code>#include &lt;RemoteXY.h&gt;
#define REMOTEXY_MODE__HARDSERIAL</code></pre></div><p>to <br /></p><div class="codebox"><pre><code>#define REMOTEXY_MODE__HARDSERIAL
#include &lt;RemoteXY.h&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ttijass]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2407</uri>
			</author>
			<updated>2023-04-14T11:28:19Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5103#p5103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PlatformIO error 'remotexy' not declared in this scope]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5102#p5102" />
			<content type="html"><![CDATA[<p>Now i created a new project and it compiled. I&#039;m very confused.</p>]]></content>
			<author>
				<name><![CDATA[ttijass]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2407</uri>
			</author>
			<updated>2023-04-14T11:22:54Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5102#p5102</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[PlatformIO error 'remotexy' not declared in this scope]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5101#p5101" />
			<content type="html"><![CDATA[<p>Hey, I&#039;m trying to compile my project using VSC PlatformIO, but the compiler returns the output below.<br />I can&#039;t figure this one out so thank you in advance for any kind of help.</p><p>TTS</p><p>platformio.ini file:</p><div class="codebox"><pre><code>; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
lib_deps = 
    br3ttb/PID@^1.2.1
    jrowberg/I2Cdevlib-MPU6050@^1.0.0
    https://github.com/RemoteXY/RemoteXY-Arduino-library.git</code></pre></div><p>OUTPUT:<br /></p><div class="quotebox"><blockquote><p>Processing nanoatmega328 (platform: atmelavr; board: nanoatmega328; framework: arduino)<br />-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br />Verbose mode can be enabled via `-v, --verbose` option&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CONFIGURATION: <a target="_blank" href="https://docs.platformio.org/page/boards/atmelavr/nanoatmega328.html">https://docs.platformio.org/page/boards … ga328.html</a><br />PLATFORM: Atmel AVR (4.1.0) &gt; Arduino Nano ATmega328<br />HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash<br />DEBUG: Current (avr-stub) External (avr-stub, simavr)<br />PACKAGES:<br /> - framework-arduino-avr @ 5.1.0<br /> - toolchain-atmelavr @ 1.70300.191015 (7.3.0)<br />LDF: Library Dependency Finder -&gt; <a target="_blank" href="https://bit.ly/configure-pio-ldf">https://bit.ly/configure-pio-ldf</a><br />LDF Modes: Finder ~ chain, Compatibility ~ soft<br />Found 9 compatible libraries<br />Scanning dependencies...<br />Dependency Graph<br />|-- PID @ 1.2.1<br />|-- I2Cdevlib-MPU6050 @ 1.0.0<br />|&nbsp; &nbsp;|-- I2Cdevlib-Core @ 1.0.1<br />|&nbsp; &nbsp;|&nbsp; &nbsp;|-- Wire @ 1.0<br />|-- RemoteXY @ 3.1.10+sha.743dad0<br />|&nbsp; &nbsp;|-- SoftwareSerial @ 1.0<br />|-- Wire @ 1.0<br />|-- EEPROM @ 2.0<br />|-- I2Cdevlib-Core @ 1.0.1<br />|&nbsp; &nbsp;|-- Wire @ 1.0<br />Building in release mode<br />Compiling .pio\build\nanoatmega328\src\main.cpp.o<br />Compiling .pio\build\nanoatmega328\lib7bb\PID\PID_v1.cpp.o<br />Compiling .pio\build\nanoatmega328\lib89d\Wire\Wire.cpp.o<br />Compiling .pio\build\nanoatmega328\lib89d\Wire\utility\twi.c.o<br />Compiling .pio\build\nanoatmega328\libafe\I2Cdevlib-Core\I2Cdev.cpp.o<br />Compiling .pio\build\nanoatmega328\lib311\I2Cdevlib-MPU6050\MPU6050.cpp.o<br />Compiling .pio\build\nanoatmega328\lib311\I2Cdevlib-MPU6050\MPU6050_6Axis_MotionApps20.cpp.o<br />Compiling .pio\build\nanoatmega328\lib311\I2Cdevlib-MPU6050\MPU6050_6Axis_MotionApps612.cpp.o<br />In file included from src\main.cpp:5:0:<br />src\main.cpp: In function &#039;void loop()&#039;:<br />.pio\libdeps\nanoatmega328\RemoteXY\src/RemoteXY.h:163:28: error: &#039;remotexy&#039; was not declared in this scope<br /> #define RemoteXY_Handler() remotexy-&gt;handler ()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^<br />src\main.cpp:280:5: note: in expansion of macro &#039;RemoteXY_Handler&#039;<br />&nbsp; &nbsp; &nbsp;RemoteXY_Handler();<br />&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~<br />.pio\libdeps\nanoatmega328\RemoteXY\src/RemoteXY.h:163:28: note: suggested alternative: &#039;RemoteXY&#039;<br /> #define RemoteXY_Handler() remotexy-&gt;handler ()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^<br />src\main.cpp:280:5: note: in expansion of macro &#039;RemoteXY_Handler&#039;<br />&nbsp; &nbsp; &nbsp;RemoteXY_Handler();<br />&nbsp; &nbsp; &nbsp;^~~~~~~~~~~~~~~~<br />src\main.cpp: At global scope:<br />src\main.cpp:50:3: warning: &#039;RemoteXY&#039; defined but not used [-Wunused-variable]<br /> } RemoteXY;<br />&nbsp; &nbsp;^~~~~~~~<br />In file included from src\main.cpp:2:0:<br />C:\Users\TTS\.platformio\packages\framework-arduino-avr\libraries\EEPROM\src/EEPROM.h:145:20: warning: &#039;EEPROM&#039; defined but not used [-Wunused-variable]<br /> static EEPROMClass EEPROM;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~<br />Archiving .pio\build\nanoatmega328\lib7bb\libPID.a<br />Archiving .pio\build\nanoatmega328\libafe\libI2Cdevlib-Core.a<br />*** [.pio\build\nanoatmega328\src\main.cpp.o] Error 1<br />Indexing .pio\build\nanoatmega328\libafe\libI2Cdevlib-Core.a<br />Indexing .pio\build\nanoatmega328\lib7bb\libPID.a<br />========================================================================================================== [FAILED] Took 2.66 seconds ==========================================================================================================</p><p> *&nbsp; The terminal process &quot;C:\Users\TTS\.platformio\penv\Scripts\platformio.exe &#039;run&#039;&quot; terminated with exit code: 1.</p></blockquote></div><p>FULL CODE:<br /></p><div class="codebox"><pre><code>#include &lt;Arduino.h&gt;
#include &lt;EEPROM.h&gt;
#include &lt;I2Cdev.h&gt;
#include &lt;PID_v1.h&gt;
#include &lt;RemoteXY.h&gt;

#include &quot;MPU6050_6Axis_MotionApps20.h&quot;
//------------------------------------------------------------------------
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include &quot;Wire.h&quot;
#endif
// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation is used in I2Cdev.h

/////////////////////////////////////////////
//              RemoteXY                  //

#define REMOTEXY_MODE__HARDSERIAL
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 115200

#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =  // 113 bytes
    {255, 8, 0, 32, 0, 116, 0, 16, 31, 0, 5, 42, 6, 26, 30, 30, 2, 26, 31, 10,
     48, 1, 9, 15, 15, 4, 26, 31, 79, 78, 0, 31, 79, 70, 70, 0, 66, 193, 1, 1,
     16, 7, 49, 132, 67, 4, 21, 2, 77, 5, 2, 26, 31, 4, 0, 83, 15, 9, 46, 2,
     26, 129, 0, 55, 25, 5, 6, 17, 75, 105, 0, 129, 0, 40, 25, 7, 6, 17, 75, 112,
     0, 129, 0, 69, 25, 7, 6, 17, 75, 100, 0, 4, 0, 40, 6, 7, 18, 2, 26, 4,
     0, 55, 6, 7, 18, 2, 26, 4, 0, 69, 6, 7, 18, 2, 26, 3, 130, 81, 9, 14,
     8, 2, 26};

// this structure defines all the variables and events of your control interface
struct {
    // input variables
    int8_t joystick_1_x;   // from -100 to 100
    int8_t joystick_1_y;   // from -100 to 100
    uint8_t pushSwitch_1;  // =1 if state is ON, else =0
    int8_t slider_1;       // =0..100 slider position
    int8_t slider_2;       // =0..100 slider position
    int8_t slider_3;       // =0..100 slider position
    int8_t slider_4;       // =0..100 slider position
    uint8_t select_1;      // =0 if select position A, =1 if position B, =2 if position C, ...

    // output variables
    int8_t level_1;   // =0..100 level position
    char text_1[21];  // string UTF8 end zero

    // other variable
    uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

//               END RemoteXY              //
/////////////////////////////////////////////

/////////////////////////////////////////////
//                 DRONE                   //
// Battery
#define ALPHA 0.1
#define MULTIPLIER 6.67
float motorBattery;

// PID
int targetSpeed[4];
#define ADDR_PITCH_OFFSET 0
#define ADDR_ROLL_OFFSET 0
#define FL_MOTOR 3
#define BL_MOTOR 9
#define BR_MOTOR 10
#define FR_MOTOR 11

// Define variables we&#039;ll be connecting to
double rollSetpoint, rollInput, rollOutput;
double pitchSetpoint, pitchInput, pitchOutput;
double yawSetpoint, yawInput, YawOutput;

// Define the aggressive and conservative Tuning Parameters
double rpKp = 0.5, rpKi = 0.05, rpKd = 0.05;  // roll, pitch kp, ki, kd
double yKp = 0.5, yKi = 0.05, yKd = 0.05;     // yaw kp ki kd

PID pitchPID(&amp;rollInput, &amp;rollOutput, &amp;rollSetpoint, rpKp, rpKi, rpKd, DIRECT);
PID rollPID(&amp;pitchInput, &amp;pitchOutput, &amp;pitchSetpoint, rpKp, rpKi, rpKd, DIRECT);
// PID yawPID(&amp;yawInput, &amp;YawOutput, &amp;yawSetpoint, yKp, yKi, yKd, DIRECT);
//                  DRONE                  //
/////////////////////////////////////////////

/////////////////////////////////////////////
//                 MPU                    //

//    LED
#define LED_PIN 13
bool blinkState = false;

MPU6050 mpu;
// MPU control/status vars
bool dmpReady = false;   // set true if DMP init was successful
uint8_t mpuIntStatus;    // holds actual interrupt status byte from MPU
uint8_t devStatus;       // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize;     // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount;      // count of all bytes currently in FIFO
uint8_t fifoBuffer[64];  // FIFO storage buffer

// orientation/motion vars
Quaternion q;         // [w, x, y, z]         quaternion container
VectorInt16 aa;       // [x, y, z]            accel sensor measurements
VectorInt16 aaReal;   // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld;  // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity;  // [x, y, z]            gravity vector
float euler[3];       // [psi, theta, phi]    Euler angle container
float ypr[3];         // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector
float ypr_cal[3];

// ===               INTERRUPT DETECTION ROUTINE                ===
volatile bool mpuInterrupt = false;  // indicates whether MPU interrupt pin has gone high
void dmpDataReady() {
    mpuInterrupt = true;
}
//                   MPU                   //
/////////////////////////////////////////////

// ================================================================
// ===                      INITIAL SETUP                       ===
// ================================================================
void setup() {
    RemoteXY_Init();
    Serial.begin(115200);

    // join I2C bus (I2Cdev library doesn&#039;t do this automatically)
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    Wire.begin();
    TWBR = 24;  // 400kHz I2C clock (200kHz if CPU is 8MHz)
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
    Fastwire::setup(400, true);
#endif

    for (int i = 0; i &lt; 3; i++) {
        ypr_cal[i] = 0.0;
    }

    // Enable internal reference of 1.1V
    // initialise battery level array with current battery level value
    pinMode(A0, INPUT);
    analogReference(INTERNAL);
    //  float tmp = analogRead(A0) / 1023.0 * MULTIPLIER;
    motorBattery = 4.2;
    //------------------------------PID----------------------------------
    // initialize the variables we&#039;re linked to
    pitchInput = 0.0;
    rollInput = 0.0;
    // yawInput = 0.0;

    pitchSetpoint = 0.0;
    rollSetpoint = 0.0;
    // yawSetpoint = 0.0;

    // turn the PID on
    pitchPID.SetMode(AUTOMATIC);
    rollPID.SetMode(AUTOMATIC);
    // yawPID.SetMode(AUTOMATIC);

    pitchPID.SetOutputLimits(-10, 10);
    rollPID.SetOutputLimits(-10, 10);
    // yawPID.SetOutputLimits(-45, 45);
    //-------------------------------------------------------------------
    for (int i = 0; i &lt; 4; i++) {
        targetSpeed[i] = 0;
    }

    pinMode(FL_MOTOR, OUTPUT);
    pinMode(FR_MOTOR, OUTPUT);
    pinMode(BR_MOTOR, OUTPUT);
    pinMode(BL_MOTOR, OUTPUT);

    mpu.initialize();

    // verify connection
    Serial.println(F(&quot;Testing device connections...&quot;));
    Serial.println(mpu.testConnection() ? F(&quot;MPU6050 connection successful&quot;) : F(&quot;MPU6050 connection failed&quot;));

    // wait for ready
    Serial.println(F(&quot;\nSend any character to begin DMP programming and demo: &quot;));
    while (Serial.available() &amp;&amp; Serial.read())
        ;  // empty buffer
    while (!Serial.available())
        ;  // wait for data
    while (Serial.available() &amp;&amp; Serial.read())
        ;  // empty buffer again

    // load and configure the DMP
    Serial.println(F(&quot;Initializing DMP...&quot;));
    devStatus = mpu.dmpInitialize();

    // // supply your own gyro offsets here, scaled for min sensitivity
    // mpu.setXGyroOffset(220);
    // mpu.setYGyroOffset(76);
    // mpu.setZGyroOffset(-85);
    // mpu.setZAccelOffset(1788);  // 1688 factory default for my test chip

    // make sure it worked (returns 0 if so)
    if (devStatus == 0) {
        // turn on the DMP, now that it&#039;s ready
        Serial.println(F(&quot;Enabling DMP...&quot;));
        mpu.setDMPEnabled(true);

        // enable Arduino interrupt detection
        Serial.println(F(&quot;Enabling interrupt detection (Arduino external interrupt 0)...&quot;));
        attachInterrupt(0, dmpDataReady, RISING);
        mpuIntStatus = mpu.getIntStatus();

        // set our DMP Ready flag so the main loop() function knows it&#039;s okay to use it
        Serial.println(F(&quot;DMP ready! Waiting for first interrupt...&quot;));
        dmpReady = true;

        // get expected DMP packet size for later comparison
        packetSize = mpu.dmpGetFIFOPacketSize();
    } else {
        // ERROR!
        // 1 = initial memory load failed
        // 2 = DMP configuration updates failed
        // (if it&#039;s going to break, usually the code will be 1)
        Serial.print(F(&quot;DMP Initialization failed (code &quot;));
        Serial.print(devStatus);
        Serial.println(F(&quot;)&quot;));
    }

    // configure LED for output
    pinMode(LED_PIN, OUTPUT);
}

float smoothBattery(float prevEntry, float newEntry, float alpha) {
    return (1 - alpha) * prevEntry + alpha * newEntry;
}

void setSpeed(int val) {
    analogWrite(FL_MOTOR, val);
    analogWrite(FR_MOTOR, val);
    analogWrite(BR_MOTOR, val);
    analogWrite(BL_MOTOR, val);
}

void stabilise(int* currSpeed, int* actSpeed, float rollDiff, float pitchDiff) {
    actSpeed[0] = (int)currSpeed[0] + (rollDiff) - (pitchDiff);  // each motor has actual Speed and speed at which we want them to fly...
    actSpeed[1] = (int)currSpeed[1] + (rollDiff) + (pitchDiff);
    actSpeed[2] = (int)currSpeed[2] - (rollDiff) + (pitchDiff);  // actual Speed is calculated as follows +- half rollDiff +- half pitchDiff
    actSpeed[3] = (int)currSpeed[3] - (rollDiff) - (pitchDiff);

    for (int i = 0; i &lt; 4; i++) {
        if (actSpeed[i] &lt; 0)
            actSpeed[i] = 0;
    }
}

void checkIndividual(int motor, int* actSpeed) {
    analogWrite(FL_MOTOR, 0);
    analogWrite(FR_MOTOR, 0);
    analogWrite(BR_MOTOR, 0);
    analogWrite(BL_MOTOR, 0);

    if (motor == 0)
        analogWrite(FL_MOTOR, actSpeed[0]);
    if (motor == 1)
        analogWrite(FR_MOTOR, actSpeed[1]);
    if (motor == 2)
        analogWrite(BR_MOTOR, actSpeed[2]);
    if (motor == 3)
        analogWrite(BL_MOTOR, actSpeed[3]);
}

void runIndividual(int* actSpeed) {
    analogWrite(FL_MOTOR, actSpeed[0]);
    analogWrite(FR_MOTOR, actSpeed[1]);
    analogWrite(BR_MOTOR, actSpeed[2]);
    analogWrite(BL_MOTOR, actSpeed[3]);
}

// ================================================================
// ===                    MAIN PROGRAM LOOP                     ===
// ================================================================
void loop() {
    RemoteXY_Handler();

    // if programming failed, don&#039;t try to do anything
    if (!dmpReady) return;

    // if (Serial.available()) {
    //   myReading = Serial.parseInt();
    // for (int i = 0; i &lt; 4; i++) {
    //   targetSpeed[i] = 0.0;
    // }

    //   runIndividual(targetSpeed);
    //   while (Serial.available())  //flushing anything that wasn&#039;t read
    //     Serial.read();
    //      runIndividual(myReading);
    //      checkMotor(myReading);
    //        checkIndividual(myReading);
    //}

    // wait for MPU interrupt or extra packet(s) available
    //      while (!mpuInterrupt &amp;&amp; fifoCount &lt; packetSize) {
    // if you are really paranoid you can frequently test in between other
    // stuff to see if mpuInterrupt is true, and if so, &quot;break;&quot; from the
    // while() loop to immediately process the MPU data
    //    }

    // reset interrupt flag and get INT_STATUS byte
    mpuInterrupt = false;
    mpuIntStatus = mpu.getIntStatus();

    // get current FIFO count
    fifoCount = mpu.getFIFOCount();

    // check for overflow (this should never happen unless our code is too inefficient)
    if ((mpuIntStatus &amp; 0x10) || fifoCount == 1024) {
        // reset so we can continue cleanly
        mpu.resetFIFO();
        //        Serial.println(F(&quot;FIFO overflow!&quot;));

        // otherwise, check for DMP data ready interrupt (this should happen frequently)
    } else if (mpuIntStatus &amp; 0x02) {
        // wait for correct available data length, should be a VERY short wait
        while (fifoCount &lt; packetSize) fifoCount = mpu.getFIFOCount();

        // read a packet from FIFO
        mpu.getFIFOBytes(fifoBuffer, packetSize);

        // track FIFO count here in case there is &gt; 1 packet available
        // (this lets us immediately read more without waiting for an interrupt)
        fifoCount -= packetSize;

        // get Euler angles in degrees
        mpu.dmpGetQuaternion(&amp;q, fifoBuffer);
        mpu.dmpGetGravity(&amp;gravity, &amp;q);
        mpu.dmpGetYawPitchRoll(ypr, &amp;q, &amp;gravity);
    }

    //----------------------------------------PID-----------------------------------------
    //   if (myReading == 0) {
    //     Serial.println(F(&quot;CALIBRATING&quot;));
    //     ypr_cal[0] = ypr[0] * 180 / M_PI;
    //     ypr_cal[1] = ypr[1] * 180 / M_PI;
    //     ypr_cal[2] = ypr[2] * 180 / M_PI;

    //     //              ypr_cal[1] = 1.26;
    //     //              ypr_cal[2] = -0.55;
    //   }

    //   yawInput = ypr[0] * 180 / M_PI - ypr_cal[0];
    //   pitchInput = ypr[1] * 180 / M_PI - ypr_cal[1];
    //   rollInput = ypr[2] * 180 / M_PI - ypr_cal[2];

    //   //            pitchInput /= 2.0;
    //   //            rollInput /= 2.0;

    //   yawPID.Compute();
    //   pitchPID.Compute();
    //   rollPID.Compute();

    //   int actSpeed[4];
    //   stabilise(targetSpeed, actSpeed, rollOutput, pitchOutput);
    //   //    targetSpeed = actSpeed; // should this behere or not?

    //   Serial.print(F(&quot;pitchInput=&quot;));
    //   Serial.print(pitchInput);
    //   Serial.print(F(&quot;   pitchOutput=&quot;));
    //   Serial.print(pitchOutput);

    //   Serial.print(F(&quot;   rollInput=&quot;));
    //   Serial.print(rollInput);
    //   Serial.print(F(&quot;   rollOutput=&quot;));
    //   Serial.print(rollOutput);

    //   Serial.print(F(&quot;   mot[0]=&quot;));
    //   Serial.print(actSpeed[0]);
    //   Serial.print(F(&quot;   mot[1]=&quot;));
    //   Serial.print(actSpeed[1]);
    //   Serial.print(F(&quot;   mot[2]=&quot;));
    //   Serial.print(actSpeed[2]);
    //   Serial.print(F(&quot;   mot[3]=&quot;));
    //   Serial.println(actSpeed[3]);

    //   //runIndividual (actSpeed);
    //   //            checkIndividual(myReading, actSpeed);
    //   //------------------------------------------------------------------------------------
    //   motorBattery = smoothBattery(motorBattery, analogRead(A0) / 1023.0 * MULTIPLIER, ALPHA);
    //   if (motorBattery &lt; 2.0) {
    //     Serial.println(F(&quot;WARNING! LOW BATTERY!&quot;));
    //   }
    //   Serial.print(motorBattery);
    //   Serial.print(F(&quot;   ypr   &quot;));
    //   Serial.print(ypr[0] * 180 / M_PI);
    //   Serial.print(&quot;   &quot;);
    //   Serial.print(ypr[1] * 180 / M_PI);
    //   Serial.print(&quot;   &quot;);
    //   Serial.println(ypr[2] * 180 / M_PI);

    //   // blink LED to indicate activity
    //   blinkState = !blinkState;
    //   digitalWrite(LED_PIN, blinkState);
    // }
    // delay(100);
}</code></pre></div><p>RemoteXY.h error detected here on line 163 :</p><div class="codebox"><pre><code>#define RemoteXY_Handler() remotexy-&gt;handler ()</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ttijass]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2407</uri>
			</author>
			<updated>2023-04-14T10:07:39Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5101#p5101</id>
		</entry>
</feed>
