Release notes version 1.0.0!
by Bits and Droids | 21-03-2023

It took a while but it's finally here. I've never smacked down so many bugs in between updates like this one. As of now, we've officially added all the basic functionalities. We can send any command, receive any command, and most importantly use any microcontroller we want. Therefore I'm proud to call it version 1. Does this mean it's done? No, we still have lots to do and improve on. Stay tuned.
Community folder

Whenever you wanted to set your community folder the connector made you type in the path. Who does that in 2022? Exactly! Out with the old in with the new. Whenever you want to set the community folder path a file dialog will open. Select the community folder and press save. Easy as that! If the connector can't find your community folder by default and you try to install the wasm module it will show the same dialog. This way the module won't end up in the void.
Event editor window
- Add/remove/edit input events
- Add/remove/edit output events!
- Generate custom event file
- Save dialog that displays all the changes

The event editor window lets you add any output/input/axis your heart desires. In MFS2020, the event format is susceptible to spaces. If you forget to add space behind certain characters, the event will simply fail. The editor searches these characters and applies the spacing automatically if you forgot.
Output menu
- Changed the layout. This prevents the save button from disappearing into the void
- A new set can be created with a popup (makes the interaction simpler)
- Tab for custom outputs

You've just created your custom events. But how do you send them to your Arduino? I've added a custom events tab in the outputs menu. From here you're able to add your custom event to a set of your choice.
It was quite the puzzle to make everything play nice together. Imagine that you've created an event, added it to a set, and gone about your day. Later on, you remove the event from the event file. If you'd start the connector it would try to load in an event that no longer existed. It tried to load a checkbox that no longer existed. And eventually, the connector would crash.
The way the connector handles these kinds of scenarios is that it checks if the saved outputs exist before starting any connections. If the output doesn't exist it removes it from your output set and saves an updated version. Next time you load up the connector, the non-existing connection will be erased from memory.
Hitting save generates a new event file that is saved in the folder of the connector in the directory:
BitsAndDroidsModule/modules/events.txt
Don't forget to place this new events file in the community folder (this will be automated in the future).
But what about my Arduino?
That leaves us with the library. I'm working on a custom library generator that adds your custom events for you. This isn't implemented yet at this point. Adding an event still requires some minor tweaks on your end.
For this example, we'll use an event that is called fuelLevel with a prefix of 4000.
- Go to your Arduino library folder
- Open the BitsAndDroidsFlightConnector folder
- Open the BitsAndDroidsFlightConnector.h file
- Search for the word private
- Add a variable to hold your custom event (I.e. int fuelLevel;)

- Search for the word public
- Add a get function (i.e. int getFuelLevel(){return fuelLevel;};

- Save
- Open the BitsAndDroidsFlightConnector.cpp file
- Search for switch(prefixVal)
- Add a case that matches your custom event prefix. I.e. case 4000: { fuelLevel = cutValue.toInt(); break;}

- Save
You've added your custom event to the library! In a sketch, you're able to retrieve the value by calling the getFuel() function you're just created. This step might be a bit daunting to some but it opens up a whole new world of possibilities. Don't worry we will automate this step in the next update.