Home ยป Release notes 0.8.4

Release notes 0.8.4

by Bits and Droids
Published: Last Updated on 0 comment

For those who need to re-upload an old sketch, this update might have a decent impact. Let’s paint a picture with some variables.

  • Airspeed is a numeric value i.e., 1000
  • Altitude is a numeric value, i.e. 30000
  • The heading is a numeric value i.e., 255

These numeric values were all stored as a String. In normal computers, the size and performance impact of this would be negligible (perhaps sloppy), but for our small controller, size does matter. To free up unnecessary space, I’ve moved most of it away from String to ints or even more economically bytes. I’ll add a list of all the affected variables at the end of the patch notes. There are still some left to be converted (mainly to char*).

Fixed

I want to mention the help of Pontiac51 on this one since he pointed out some nasty bugs that were pressent.

  • Output not closing the connection properly
  • Input not closing the connection properly
  • Input not working if only one connection was selected and no second one was added. If you ever pressed the + button, the setting was saved that checked the number of connections to open (if you did this, you wouldn’t have noticed this bug). The default for no extra connections was missing.
  • The outputs used to create a new SerialPort object and send the data to this object every newly available data (how this ever seemed like a good idea is beyond me). Now the object is only opened (and closed) once.
  • OBS Nav 1 returns the correct needle value
  • OBS Nav 2 returns the correct needle value

Brakes

Added the possibility to control the brakes with a potentiometer. You’re even able to control each individually by assigning a different left and right pin. If you want to have one potentiometer to control both pedals, you can assign the same pin to the left or right brake.

connector.sendSetBrakePot(byte leftPin, byte rightPin,int minVal, int maxVal);

#include<BitsAndDroidsFlightConnector.h>
BitsAndDroidsFlightConnector connector(false);

const byte potentiometerA = A0;
const byte potentiometerB = A1;
void setup() {
  Serial.begin(115200);
}

void loop() {
  //Brakes with 1 potentiometer
  connector.sendSetBrakePot(potentiometerA, potentiometerA, 0, 1023);
  //Brakes with 2 different potentiometers
  connector.sendSetBrakePot(potentiometerA, potentiometerB, 0, 1023);
}

Rudder

The rudder is a fixed axis controlled by a potentiometer currently. In case you don’t want to use a potentiometer, you’re able to send a serial command in the following format: “901 value”. The value must be on a scale of -16383 to 16383, where 0 is the neutral position. Later on, I will add more options.
If you want to use a potentiometer, you’re able to use the following function.

connector.sendSetRudderPot(byte potPin,int minVal, int maxVal);

#include<BitsAndDroidsFlightConnector.h>
BitsAndDroidsFlightConnector connector(false);

const byte potentiometerA = A0;

void setup() {
  Serial.begin(115200);
}

void loop() {
  //Rudder with 1 potentiometer, The middle == 0 == neutral position
connector.sendSetRudderPot(potentiometerA,0,1023); 
}

Changed variables

All these variables have changed from Strings to ints/bytes. I’ve grouped several variables, like the gear positions. These encapsulate all the gear percentage variables available.

VariableNew type
AP vs speedint
AP alt lockint
GPS course to steerint
AP heading lockint
KohlmanAltimeterint
Bar pressureint
Fuel total pctbyte
Indicated airspeedint
Indicated altitudeint
Indicated headingint
Indicated GPS groundspeedint
True vertical speedint
Flaps handle pctbyte
Flaps handle indexbyte
Flaps num handle positionbyte
Trailing/leading-edge flaps left/right pctbyte
Trailing/leading-edge flaps left/right angleint
Gear hydraulic pressureint
Gear positions pctbyte
Trim pctbyte
Trim degree / posint

You may also like

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept