API Documentation v0.0.1
Loading...
Searching...
No Matches
OHSketchTemplate.ino
Go to the documentation of this file.
1/**************************************************************************************
2 * ____ _ _ _
3 * / __ \ | | | | | |
4 * | | | |_ __ ___ _ __ | |__| | ___ _ __ _ __ ___| |_
5 * | | | | '_ \ / _ \ '_ \| __ |/ _ \| '__| '_ \ / _ \ __|
6 * | |__| | |_) | __/ | | | | | | (_) | | | | | | __/ |_
7 * \____/| .__/ \___|_| |_|_| |_|\___/|_| |_| |_|\___|\__|
8 * | |
9 * |_|
10 * ----------------------------------------------------------------------------------
11 * Copyright 2016-2025 OpenHornet
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 * ----------------------------------------------------------------------------------
25 * Note: All other portions of OpenHornet not within the 'OpenHornet-Software'
26 * GitHub repository is released under the Creative Commons Attribution -
27 * Non-Commercial - Share Alike License. (CC BY-NC-SA 4.0)
28 * ----------------------------------------------------------------------------------
29 * This Project uses Doxygen as a documentation generator.
30 * Please use Doxygen capable comments.
31 **************************************************************************************/
32
68#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega2560__)
69#define DCSBIOS_IRQ_SERIAL
70#else
71#define DCSBIOS_DEFAULT_SERIAL
72#endif
73
74#ifdef __AVR__
75#include <avr/power.h>
76#endif
77
82#define TXENABLE_PIN 5
83#define UART1_SELECT
84
89//#define DCSBIOS_RS485_SLAVE 1 ///DCSBios RS485 Bus Address,
90
95#define DCSBIOS_DISABLE_SERVO
96
100#include "DcsBios.h"
101
102// Define pins for DCS-BIOS per interconnect diagram.
103#define PIN_NAME1 A1
104#define PIN_NAME2 A2
105
106//Declare variables for custom non-DCS logic <update comment as needed>
107bool wowLeft = true;
108bool wowRight = true;
109
110// Connect switches to DCS-BIOS
111DcsBios::Switch2Pos emergencyGearRotate("EMERGENCY_GEAR_ROTATE", PIN_NAME1); //delete example and this comment.
112
113// DCSBios reads to save airplane state information. <update comment as needed>
114void onExtWowLeftChange(unsigned int newValue) {
115 wowLeft = newValue;
116}
117
118// Use the Values in Addresses.h instead of hard coding addresses.
119DcsBios::IntegerBuffer extWowLeftBuffer(FA_18C_hornet_EXT_WOW_LEFT, onExtWowLeftChange);
120
157int sampleFunction(int myParam1 = 1, int myParam2 = 2) {
158 int myReturn = myParam1 + myParam2;
159 return myReturn;
160}
161
168void setup() {
169 #if (not defined( DCSBIOS_RS485_SLAVE) || not defined(DCSBIOS_RS485_MASTER )) // Disable RS485 TRANSCEIVER IF NOT BEING USED
170 pinMode(TXENABLE_PIN, OUTPUT); // WILL DISABLE TX ONLY
171 digitalWrite(TXENABLE_PIN, HIGH); // SET TX HIGH TO DISABLE TX ON TRANSCEIVER
172 #endif
173
174 // Run DCS Bios setup function
175 DcsBios::setup(); // Must be called once in setup();
176}
177
184void loop() {
185
186 //Run DCS Bios loop function
187 DcsBios::loop(); // Must be called once in loop();
188}
bool wowLeft
Update variables as needed and update this Doxygen comment, or remove line/section if not needed.
int sampleFunction(int myParam1=1, int myParam2=2)
#define PIN_NAME1
function 1
void setup()
#define TXENABLE_PIN
Sets TXENABLE_PIN to Arduino Pin 5.
bool wowRight
Update variables as needed and update this Doxygen comment, or remove line/section if not needed.
void loop()