Converting analog to digital signal 53Pin on arduino mega for realdash

Hello everyone, I need help.
We need to make sure that all the digital outputs of 53 pins are used on the arduino mega, only 12 work, the xml file is also redone, but there is no result, please help.

type or paste code here
```/**
 * ============================================================================
 *  Name        : RealDash_CAN.ino
 *  Part of     : RealDash
 *  Author      : Jani Immonen
 *  Created     : 15.10.2017
 *
 * Arduino example sketch of how to use RealDash CAN protocol.
 * 
 * This example code is free for any use.
 * 
 * www.realdash.net
 * ============================================================================
**/


// Arduino digital and analog pins
unsigned int digitalPins = 0;
int analogPins[7] = {0};




void setup()
{
  // init serial
  Serial.begin(115200);
  delay(100);
}


void loop()
{
  ReadDigitalStatuses();
  ReadAnalogStatuses();
  SendCANFramesToSerial();

  // just some dummy values for simulated engine parameters
  if (rpm++ > 10000)
  {
    rpm = 500;
  }
  if (kpa++ > 2500)
  {
    kpa = 10;
  }
  if (tps++ > 1000)
  {
    tps = 0;
  }
  if (clt++ > 230)
  {
    // all values in frame are handled as unsigned values. To have negative values,
    // offset actual value and write corresponding conversion to xml file imported to RealDash
    clt = 0;
  }
  if (textCounter++ > 4000)
  {
    textCounter = 0;
  }
  
  delay(5);
}


void ReadDigitalStatuses()
{
  // read status of digital pins (1-53)
  digitalPins = 0;

  int bitposition = 0;
  for (int i=1; i<14; i++)
  {
    if (digitalRead(i) == HIGH) digitalPins |= (1 << bitposition);
    bitposition++;
  }
}


void ReadAnalogStatuses()
{
  // read analog pins (0-7)
  for (int i=0; i<7; i++)
  {
    analogPins[i] = analogRead(i);
  }
}


void SendCANFramesToSerial()
{
  byte buf[8];

  // build & send CAN frames to RealDash.
  // a CAN frame payload is always 8 bytes containing data in a manner
  // described by the RealDash custom channel description XML file
  // all multibyte values are handled as little endian by default.
  // endianess of the values can be specified in XML file if it is required to use big endian values

  // build 1st CAN frame, RPM, MAP, CLT, TPS (just example data)
  memcpy(buf, &rpm, 2);
  memcpy(buf + 2, &kpa, 2);
  memcpy(buf + 4, &clt, 2);
  memcpy(buf + 6, &tps, 2);

  // write first CAN frame to serial
  SendCANFrameToSerial(3200, buf);

  // build 2nd CAN frame, Arduino digital pins and 2 analog values
  memcpy(buf, &digitalPins, 2);
  memcpy(buf + 2, &analogPins[0], 2);
  memcpy(buf + 4, &analogPins[1], 2);
  memcpy(buf + 6, &analogPins[2], 2);

  // write 2nd CAN frame to serial
  SendCANFrameToSerial(3201, buf);

  // build 3rd CAN frame, rest of Arduino analog values
  memcpy(buf, &analogPins[3], 2);
  memcpy(buf + 2, &analogPins[4], 2);
  memcpy(buf + 4, &analogPins[5], 2);
  memcpy(buf + 6, &analogPins[6], 2);

  // write 3rd CAN frame to serial
  SendCANFrameToSerial(3202, buf);

  // build 4th frame, this is a text extension frame
  // only send once at 1000 loops
  if (textCounter == 0)
  {
    SendTextExtensionFrameToSerial(3203, "Hello RealDash, this is Arduino sending some text data");
  }
  else if (textCounter == 1000)
  {
    SendTextExtensionFrameToSerial(3203, "Tomorrow's forecast: Lots of sun and 30 degrees centigate");
  }
  else if (textCounter == 2000)
  {
    SendTextExtensionFrameToSerial(3203, "Now Playing: Insert your favorite song info here");
  }
  else if (textCounter == 3000)
  {
    SendTextExtensionFrameToSerial(3203, "Message from Arduino: All systems running at nominal efficiency");
  }
}


void SendCANFrameToSerial(unsigned long canFrameId, const byte* frameData)
{
  // the 4 byte identifier at the beginning of each CAN frame
  // this is required for RealDash to 'catch-up' on ongoing stream of CAN frames
  const byte serialBlockTag[4] = { 0x44, 0x33, 0x22, 0x11 };
  Serial.write(serialBlockTag, 4);

  // the CAN frame id number (as 32bit little endian value)
  Serial.write((const byte*)&canFrameId, 4);

  // CAN frame payload
  Serial.write(frameData, 8);
}


void SendTextExtensionFrameToSerial(unsigned long canFrameId, const char* text)
{
  if (text)
  {
    // the 4 byte identifier at the beginning of each CAN frame
    // this is required for RealDash to 'catch-up' on ongoing stream of CAN frames
    const byte textExtensionBlockTag[4] = { 0x55, 0x33, 0x22, 0x11 };
    Serial.write(textExtensionBlockTag, 4);

    // the CAN frame id number (as 32bit little endian value)
    Serial.write((const byte*)&canFrameId, 4);

    // text payload
    Serial.write(text, strlen(text) + 1);
  }
}

XML

type or paste code here
```<?xml version="1.0" encoding="utf-8"?>
<!-- RealDash CAN XML description file, version 2 Requires RealDash version 1.5.8 or newer -->
<RealDashCAN version="2">
  <!-- baseId [optional] is added to each frame canId. -->
  <!-- frames baseId="3200" -->
  <frames>
    <!-- PARAMETERS FOR 'frame' -->
    <!-- 'id' can identifier (= baseId + id). Use 0x prefix to enter id as hexadesimal value. For example <frame id="3200"> is equal to <frame id="0x0c80"> -->
    <!-- 'writeInterval' [optional] this CAN frame is written to CAN bus in this interval (milliseconds) -->
    <!-- 'endianess' [optional] the endianess of all frame values (big | little [default]).  -->
    <!-- 'signed' [optional, from 1.7.4] set to true to force RealDash to handle all values in frame as signed values.  -->
    <frame id="3200">
      <!-- PARAMETERS FOR 'value' -->
      <!-- 'targetId' links value to RealDash input, see RealDash manuals www for a complete list -->
      <!-- OR -->
      <!-- 'name' links value to RealDash input, input appears in 'ECU Specific' input category -->

      <!-- 'units' [optional] is used for post calculations, "F", "mph", "psi", "bit" which need to be specified for dashboard conversions to work properly -->
      <!-- 'offset' byte offset of the value in frame -->
      <!-- 'length' value length in bytes -->
      <!-- 'startbit' [optional] the index of the first bit of the value -->
      <!-- 'bitcount' [optional] number of bits used by the value -->
      <!-- 'endianess' [optional] the endianess of value (big | little [default]).  -->
      <!-- 'signed' [optional, from 1.7.4] set to true to force RealDash to handle this value as signed.  -->
      <!-- 'rangeMin' and 'rangeMax' [optional] if 'name' is used instead of 'targetId', this is the recommended value range in RealDash editor -->
      <!-- 'initialValue' [optional] if this parameter is present, value is written to CAN after connection has been made to the CAN bus -->
      <!-- 'conversion' [optional] if omitted, value is read 'as-is'.
           Otherwise variables 'B0', 'B1', 'B2', 'B3', 'V' and 'ID#' can be used within conversion formula, for example;
           conversion="V/10" - result is incoming value / 10
           conversion="B0+15*(B1-43)" - result is 'first byte + 15 * (second byte - 43)
           conversion="V+ID200-74.3" - result is incoming value + 'Body Electronics->Gear' - 74.3 -->
      <!-- From RealDash version 1.6.6, 'conversionABC' is an option to 'conversion' and uses A,B,C,...AA,AB,AC,...,etc format to distinquish the individual bytes on the reply.
           This makes it easier to convert the Equation from other apps.
           Example: conversion="B0+15*(B1-43)" and conversionABC="A+15*(B-43)" produce the same result -->

      <!-- 1st CAN frame, RPM, MAP, CLT, TPS -->
      <value targetId="37" units="RPM" offset="0" length="2"></value>
      <value targetId="31" units="kPA" offset="2" length="2" conversion="V/10"></value>
      <value targetId="14" units="C" offset="4" length="2" conversion="V-100"></value>
      <value targetId="42" units="%" offset="6" length="2" conversion="V/10"></value>
    </frame>
      
    <frame id="3201">
      <!-- 2nd CAN frame, Arduino example digital inputs, these will appear in RealDash 'ECU Specific' input category -->
      <!-- note that 9 bit values all come from same 2 bytes -->
      <!-- if units="bit", RealDash always checks the lowest bit as of value on or off. Therefore the bitshift to the right on conversion -->
      <value name="Arduino Example: Digital 1" startbit="0" bitcount="1"></value>
      <value name="Arduino Example: Digital 2" startbit="1" bitcount="1"></value>
      <value name="Arduino Example: Digital 3" startbit="2" bitcount="1"></value>
      <value name="Arduino Example: Digital 4" startbit="3" bitcount="1"></value>
      <value name="Arduino Example: Digital 5" startbit="4" bitcount="1"></value>
      <value name="Arduino Example: Digital 6" startbit="5" bitcount="1"></value>
      <value name="Arduino Example: Digital 7" startbit="6" bitcount="1"></value>
      <value name="Arduino Example: Digital 8" startbit="7" bitcount="1"></value>
      <value name="Arduino Example: Digital 9" startbit="8" bitcount="1"></value>
      <value name="Arduino Example: Digital 10" startbit="9" bitcount="1"></value>
      <value name="Arduino Example: Digital 11" startbit="10" bitcount="1"></value>
      <value name="Arduino Example: Digital 12" startbit="11" bitcount="1"></value>
      <value name="Arduino Example: Digital 13" startbit="12" bitcount="1"></value>
      <value name="Arduino Example: Digital 14" startbit="13" bitcount="1"></value>
      <value name="Arduino Example: Digital 15" startbit="14" bitcount="1"></value>
      <value name="Arduino Example: Digital 16" startbit="15" bitcount="1"></value>
      <value name="Arduino Example: Digital 17" startbit="16" bitcount="1"></value>
      <value name="Arduino Example: Digital 18" startbit="17" bitcount="1"></value>
      <value name="Arduino Example: Digital 19" startbit="18" bitcount="1"></value>
      <value name="Arduino Example: Digital 20" startbit="19" bitcount="1"></value>
      <value name="Arduino Example: Digital 21" startbit="20" bitcount="1"></value>
      <value name="Arduino Example: Digital 22" startbit="21" bitcount="1"></value>
      <value name="Arduino Example: Digital 23" startbit="22" bitcount="1"></value>
      <value name="Arduino Example: Digital 24" startbit="23" bitcount="1"></value>
      <value name="Arduino Example: Digital 25" startbit="24" bitcount="1"></value>
      <value name="Arduino Example: Digital 26" startbit="25" bitcount="1"></value>
      <value name="Arduino Example: Digital 27" startbit="26" bitcount="1"></value>
      <value name="Arduino Example: Digital 28" startbit="27" bitcount="1"></value>
      <value name="Arduino Example: Digital 29" startbit="28" bitcount="1"></value>
      <value name="Arduino Example: Digital 30" startbit="29" bitcount="1"></value>
      <value name="Arduino Example: Digital 31" startbit="30" bitcount="1"></value>
      <value name="Arduino Example: Digital 32" startbit="31" bitcount="1"></value>
      <value name="Arduino Example: Digital 33" startbit="32" bitcount="1"></value>
      <value name="Arduino Example: Digital 34" startbit="33" bitcount="1"></value>
      <value name="Arduino Example: Digital 35" startbit="34" bitcount="1"></value>
      <value name="Arduino Example: Digital 36" startbit="35" bitcount="1"></value>
      <value name="Arduino Example: Digital 37" startbit="36" bitcount="1"></value>
      <value name="Arduino Example: Digital 38" startbit="37" bitcount="1"></value>
      <value name="Arduino Example: Digital 39" startbit="38" bitcount="1"></value>
      <value name="Arduino Example: Digital 40" startbit="39" bitcount="1"></value>
      <value name="Arduino Example: Digital 41" startbit="40" bitcount="1"></value>
      <value name="Arduino Example: Digital 42" startbit="41" bitcount="1"></value>
      <value name="Arduino Example: Digital 43" startbit="42" bitcount="1"></value>
      <value name="Arduino Example: Digital 44" startbit="43" bitcount="1"></value>
      <value name="Arduino Example: Digital 45" startbit="44" bitcount="1"></value>
      <value name="Arduino Example: Digital 46" startbit="45" bitcount="1"></value>
      <value name="Arduino Example: Digital 47" startbit="46" bitcount="1"></value>
      <value name="Arduino Example: Digital 48" startbit="47" bitcount="1"></value>
      <value name="Arduino Example: Digital 49" startbit="48" bitcount="1"></value>
      <value name="Arduino Example: Digital 50" startbit="49" bitcount="1"></value>
      <value name="Arduino Example: Digital 51" startbit="50" bitcount="1"></value>
      <value name="Arduino Example: Digital 52" startbit="51" bitcount="1"></value>
      <value name="Arduino Example: Digital 53" startbit="52" bitcount="1"></value>
      <value name="Arduino Example: Analog 1" offset="2" length="2"></value>
      <value name="Arduino Example: Analog 2" offset="4" length="2"></value>
      <value name="Arduino Example: Analog 3" offset="6" length="2"></value>
    </frame>

    <!-- 3rd CAN frame contains rest of Arduino analog inputs -->
    <frame id="3202">
      <value name="Arduino Example: Analog 4" offset="0" length="2"></value>
      <value name="Arduino Example: Analog 5" offset="2" length="2"></value>
      <value name="Arduino Example: Analog 6" offset="4" length="2"></value>
      <value name="Arduino Example: Analog 7" offset="6" length="2"></value>
      <value name="Arduino Example: Analog 8" offset="8" length="2"></value>
      <value name="Arduino Example: Analog 9" offset="10" length="2"></value>
      <value name="Arduino Example: Analog 10" offset="12" length="2"></value>
      <value name="Arduino Example: Analog 11" offset="14" length="2"></value>
      <value name="Arduino Example: Analog 12" offset="16" length="2"></value>
      <value name="Arduino Example: Analog 13" offset="18" length="2"></value>
      <value name="Arduino Example: Analog 14" offset="22" length="2"></value>
      <value name="Arduino Example: Analog 15" offset="24" length="2"></value>


 </frame>

    <frame id="3203">
      <!-- 4th CAN frame, example of text extension frame -->
      <!-- Text extension frame requires RealDash 1.4.1 or newer -->
      <!-- declare own unique CAN id for each text value. -->
      <!-- the text extension frame always consumes entire CAN id, multiple text strings cannot be added to one frame. -->

      <!-- units must be set to "text" -->
      <!-- offset, length and conversion values have no meaning with text data -->
      <value name="Arduino Example: Text 1" units="text"></value>
    </frame>

  </frames>
</RealDashCAN>

Maybe your readDigitalStatuses should loop higher than:

for (int i=1; i<14; i++)

changed the data, but it doesn’t work, please help```
// Arduino digital and analog pins
unsigned int digitalPins = 53;
int analogPins[7] = {0};

unsigned int rpm = 0;
unsigned int kpa = 992; // 99.2
unsigned int tps = 965; // 96.5
unsigned int clt = 80; // 80 - 100
unsigned int textCounter = 0;

void setup()
{
// init serial
Serial.begin(115200);
delay(100);
}

void loop()
{
ReadDigitalStatuses();
ReadAnalogStatuses();
SendCANFramesToSerial();

// just some dummy values for simulated engine parameters
if (rpm++ > 10000)
{
rpm = 500;
}
if (kpa++ > 2500)
{
kpa = 10;
}
if (tps++ > 1000)
{
tps = 0;
}
if (clt++ > 230)
{
// all values in frame are handled as unsigned values. To have negative values,
// offset actual value and write corresponding conversion to xml file imported to RealDash
clt = 0;
}
if (textCounter++ > 4000)
{
textCounter = 0;
}

delay(5);
}

void ReadDigitalStatuses()
{
// read status of digital pins (0-53)
digitalPins = 53;

int bitposition = 0;
for (int i=0; i<53; i++)
{
if (digitalRead(i) == HIGH) digitalPins |= (1 << bitposition);
bitposition++;
}
}

void ReadAnalogStatuses()
{
// read analog pins (0-15)
for (int i=0; i<15; i++)
{
analogPins[i] = analogRead(i);
}
}

void SendCANFramesToSerial()
{
byte buf[8];

// build & send CAN frames to RealDash.
// a CAN frame payload is always 8 bytes containing data in a manner
// described by the RealDash custom channel description XML file
// all multibyte values are handled as little endian by default.
// endianess of the values can be specified in XML file if it is required to use big endian values

// build 1st CAN frame, RPM, MAP, CLT, TPS (just example data)
memcpy(buf, &rpm, 2);
memcpy(buf + 2, &kpa, 2);
memcpy(buf + 4, &clt, 2);
memcpy(buf + 6, &tps, 2);

// write first CAN frame to serial
SendCANFrameToSerial(3200, buf);

// build 2nd CAN frame, Arduino digital pins and 2 analog values
memcpy(buf, &digitalPins, 2);
memcpy(buf + 2, &analogPins[0], 2);
memcpy(buf + 4, &analogPins[1], 2);
memcpy(buf + 6, &analogPins[2], 2);

// write 2nd CAN frame to serial
SendCANFrameToSerial(3201, buf);

// build 3rd CAN frame, rest of Arduino analog values
memcpy(buf, &analogPins[3], 2);
memcpy(buf + 2, &analogPins[4], 2);
memcpy(buf + 4, &analogPins[5], 2);
memcpy(buf + 6, &analogPins[6], 2);

// write 3rd CAN frame to serial
SendCANFrameToSerial(3202, buf);

// build 4th frame, this is a text extension frame
// only send once at 1000 loops
if (textCounter == 0)
{
SendTextExtensionFrameToSerial(3203, “Hello RealDash, this is Arduino sending some text data”);
}
else if (textCounter == 1000)
{
SendTextExtensionFrameToSerial(3203, “Tomorrow’s forecast: Lots of sun and 30 degrees centigate”);
}
else if (textCounter == 2000)
{
SendTextExtensionFrameToSerial(3203, “Now Playing: Insert your favorite song info here”);
}
else if (textCounter == 3000)
{
SendTextExtensionFrameToSerial(3203, “Message from Arduino: All systems running at nominal efficiency”);
}
}

void SendCANFrameToSerial(unsigned long canFrameId, const byte* frameData)
{
// the 4 byte identifier at the beginning of each CAN frame
// this is required for RealDash to ‘catch-up’ on ongoing stream of CAN frames
const byte serialBlockTag[4] = { 0x44, 0x33, 0x22, 0x11 };
Serial.write(serialBlockTag, 4);

// the CAN frame id number (as 32bit little endian value)
Serial.write((const byte*)&canFrameId, 4);

// CAN frame payload
Serial.write(frameData, 8);
}

void SendTextExtensionFrameToSerial(unsigned long canFrameId, const char* text)
{
if (text)
{
// the 4 byte identifier at the beginning of each CAN frame
// this is required for RealDash to ‘catch-up’ on ongoing stream of CAN frames
const byte textExtensionBlockTag[4] = { 0x55, 0x33, 0x22, 0x11 };
Serial.write(textExtensionBlockTag, 4);

// the CAN frame id number (as 32bit little endian value)
Serial.write((const byte*)&canFrameId, 4);

// text payload
Serial.write(text, strlen(text) + 1);

}
}