API Documentation v0.0.1
Loading...
Searching...
No Matches
OHSketchTemplate.ino File Reference

<A short description of the PCB, will appear in the list of files.> More...

#include "DcsBios.h"

Go to the source code of this file.

Macros

#define DCSBIOS_DEFAULT_SERIAL
 This enables the default serial communication for DCS-BIOS. (Used with all other microcontrollers than the ATmega328P or ATmega2560.)

 
#define TXENABLE_PIN   5
 Sets TXENABLE_PIN to Arduino Pin 5.
 
#define UART1_SELECT
 Selects UART1 on Arduino for serial communication.
 
#define PIN_NAME1   A1
 function 1
 
#define PIN_NAME2   A2
 function 2
 

Functions

DcsBios::Switch2Pos emergencyGearRotate ("EMERGENCY_GEAR_ROTATE", PIN_NAME1)
 
void onExtWowLeftChange (unsigned int newValue)
 
DcsBios::IntegerBuffer extWowLeftBuffer (0x74d8, 0x0100, 8, onExtWowLeftChange)
 
void setup ()
 
void loop ()
 
int sampleFunction (int myParam1, int myParam2)
 

Variables

bool wowLeft = true
 Update variables as needed and update this Doxygen comment, or remove line/section if not needed.
 
bool wowRight = true
 Update variables as needed and update this Doxygen comment, or remove line/section if not needed.
 

Detailed Description

<A short description of the PCB, will appear in the list of files.>

Author
<Replace with author's name>
Date
<MM.DD.YYYY>
Version
u.0.0.1 (untested)
Warning
This sketch is based on a wiring diagram, and was not yet tested on hardware. (Remove this line once tested on hardware and in system.)

This is the OpenHornet Sketch Template. It should be used as a starting point for every new sketch. Please copy the whole OHSketchTemplate folder to start, and ensure the correct line in the Makefile is uncommented.

  • Reference Designator: <Replace with full reference designator.>
  • Intended Board: <Replace with the appropriate hardware, i.e. ABSIS ALE, ABSIS ALE w/ Relay Module, etc.>
  • RS485 Bus Address: <NA or RS485 Bus Address, i.e. 1, 2, 3, etc.>

Wiring diagram:

PIN Function
1 function 1
2 function 2
3 function 3

The following #define tells DCS-BIOS that this is a RS-485 slave device. It also sets the address of this slave device. The slave address should be between 1 and 126 and must be unique among all devices on the same bus.

Bug
Currently does not work with the Pro Micro (32U4), Fails to compile.

#define DCSBIOS_RS485_SLAVE 1 ///DCSBios RS485 Bus Address, once bug resolved move line below comment.

Definition in file OHSketchTemplate.ino.

Macro Definition Documentation

◆ DCSBIOS_DEFAULT_SERIAL

#define DCSBIOS_DEFAULT_SERIAL

This enables the default serial communication for DCS-BIOS. (Used with all other microcontrollers than the ATmega328P or ATmega2560.)

Check if we're on a Mega328 or Mega2560 and define the correct serial interface

Definition at line 73 of file OHSketchTemplate.ino.

◆ TXENABLE_PIN

#define TXENABLE_PIN   5

Sets TXENABLE_PIN to Arduino Pin 5.

The Arduino pin that is connected to the RE and DE pins on the RS-485 transceiver.

Definition at line 84 of file OHSketchTemplate.ino.

◆ UART1_SELECT

#define UART1_SELECT

Selects UART1 on Arduino for serial communication.

Definition at line 85 of file OHSketchTemplate.ino.

◆ PIN_NAME1

#define PIN_NAME1   A1

function 1

Definition at line 90 of file OHSketchTemplate.ino.

◆ PIN_NAME2

#define PIN_NAME2   A2

function 2

Definition at line 91 of file OHSketchTemplate.ino.

Function Documentation

◆ onExtWowLeftChange()

void onExtWowLeftChange ( unsigned int newValue)

Definition at line 101 of file OHSketchTemplate.ino.

101 {
102 wowLeft = newValue;
103} DcsBios::IntegerBuffer extWowLeftBuffer(0x74d8, 0x0100, 8, onExtWowLeftChange);
bool wowLeft
Update variables as needed and update this Doxygen comment, or remove line/section if not needed.

◆ setup()

void setup ( )

Arduino Setup Function

Arduino standard Setup Function. Code who should be executed only once at the programm start, belongs in this function.

Definition at line 112 of file OHSketchTemplate.ino.

112 {
113
114 // Run DCS Bios setup function
115 DcsBios::setup();
116}

◆ loop()

void loop ( )

Arduino Loop Function

Arduino standard Loop Function. Code who should be executed over and over in a loop, belongs in this function.

Definition at line 124 of file OHSketchTemplate.ino.

124 {
125
126 //Run DCS Bios loop function
127 DcsBios::loop();
128}

◆ sampleFunction()

int sampleFunction ( int myParam1,
int myParam2 )

A brief description on a single line, ended by a period or blank line.

A longer comment, which may stretch over several lines and may include other things like: Lists:

  • list points
  • nested list points
  • more list points

Headers Level 1

Headers Level 2

Headers Level 3

‍Block quotes

Emphasis Emphasis

code()

even Tables are supported:

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

Links: More about markdown support

Parameters
myParam1Description of 1st parameter.
myParam2Description of 2nd parameter.
Returns
Description of returned value.

Definition at line 163 of file OHSketchTemplate.ino.

163 {
164 int myReturn;
165 return myReturn;
166}

Variable Documentation

◆ wowLeft

bool wowLeft = true

Update variables as needed and update this Doxygen comment, or remove line/section if not needed.

Definition at line 94 of file OHSketchTemplate.ino.

◆ wowRight

bool wowRight = true

Update variables as needed and update this Doxygen comment, or remove line/section if not needed.

Definition at line 95 of file OHSketchTemplate.ino.