Added arming on channel 0
This commit is contained in:
@@ -52,6 +52,14 @@ void setup() {
|
||||
|
||||
#include "configuration_input.h" //Input configuration
|
||||
timerSetup();
|
||||
|
||||
//Temporary switch
|
||||
pinMode(45, OUTPUT);
|
||||
pinMode(49, OUTPUT);
|
||||
pinMode(47, INPUT);
|
||||
digitalWrite(45, LOW);
|
||||
digitalWrite(49, HIGH);
|
||||
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
*/
|
||||
|
||||
//Channel Input
|
||||
TX_CHANNELS[0][_PIN] = -1;
|
||||
TX_CHANNELS[0][_PIN] = 47;
|
||||
TX_CHANNELS[0][_TYPE] = IN_BIN;
|
||||
TX_CHANNELS[0][_MAX] = 1;
|
||||
|
||||
TX_CHANNELS[1][_PIN] = A13;
|
||||
TX_CHANNELS[1][_TYPE] = IN_CTR_POT;
|
||||
|
||||
+8
-4
@@ -12,23 +12,27 @@ bool setMessage() {
|
||||
//TX_CHANNELS[1][_VAL] = map(analogRead(TX_CHANNELS[1][_PIN]), TX_CHANNELS[1][_MIN], 1024, 0, 255);
|
||||
//TX_CHANNELS[2][_VAL] = map(analogRead(TX_CHANNELS[2][_PIN]), TX_CHANNELS[2][_MIN], 1024, 0, 255);
|
||||
|
||||
for (int i=1; i<NUM_CHANNELS; i++) {
|
||||
for (int i=0; i<NUM_CHANNELS; i++) {
|
||||
//Read inputs and mpa them to an 8 bit range
|
||||
if (TX_CHANNELS[i] [_MAX] == 0) {
|
||||
TX_CHANNELS[i] [_MAX] = DEFAULT_MAX; //If current _MAX is 0, set it to default
|
||||
}
|
||||
TX_CHANNELS[i] [_VAL] = map( analogRead( TX_CHANNELS[i][_PIN]), TX_CHANNELS[i][_MIN], TX_CHANNELS[i][_MAX], 0, 255);
|
||||
TX_CHANNELS[0][_VAL] = map( digitalRead(TX_CHANNELS[0][_PIN]), 0, 1, 0, 255);
|
||||
}
|
||||
|
||||
Serial.println();
|
||||
Serial.println(TX_CHANNELS[0][_VAL]);
|
||||
|
||||
Serial.print(analogRead(TX_CHANNELS[1][_PIN]));
|
||||
Serial.print(" < LEFT : RIGHT > ");
|
||||
Serial.print(analogRead(TX_CHANNELS[2][_PIN]));
|
||||
Serial.print(" | Send Value : ");
|
||||
Serial.print(TX_CHANNELS[1][_VAL]);
|
||||
Serial.println(TX_CHANNELS[1][_VAL]);
|
||||
|
||||
|
||||
for ( int i=1; i<_length; i++) { //Place channel values srarting at pos 2
|
||||
_SEND_MESSAGE[i] = TX_CHANNELS[i][_VAL] + _mod;
|
||||
for ( int i=0; i<_length; i++) { //Place channel values srarting at pos 2
|
||||
_SEND_MESSAGE[i] = TX_CHANNELS[i][_VAL];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user