Good morning and thanks again!
Here's the increment 2 code:
#include <SoftwareSerial.h>;
void prntBits(byte b)
{
for(int i = 7; i >= 0; i--)
Serial.print(bitRead(b,i));
}
void setup()
{
Serial.begin(9600);
byte Billy_Packet[] = {0b11111111, 0b11111111, 0b00001111, 0b10011000, 0b00110001, 0b11100001};
Serial.println("Hello ENOX!");
delay(5000);
Serial.print("Billy_Packet[0] contains ");
prntBits(Billy_Packet[0]);
Serial.println();
Serial.print("Billy_Packet[1] contains ");
prntBits(Billy_Packet[1]);
Serial.println();
Serial.print("Billy_Packet[2] contains ");
prntBits(Billy_Packet[2]);
Serial.println();
Serial.print("Billy_Packet[3] contains ");
prntBits(Billy_Packet[3]);
Serial.println();
Serial.print("Billy_Packet[4] contains ");
prntBits(Billy_Packet[4]);
Serial.println();
Serial.print("Billy_Packet[5] contains ");
prntBits(Billy_Packet[5]);
Serial.println();
Serial.println();
Serial.print("Billy_Packet[] contains ");
int i = 0;
do
{
prntBits(Billy_Packet[i]);
i = i+1;
}
while (i<6);
}
void loop()
{
}
Here's the output:
Seems to work perfect!!!
Ultimately (I believe) I'm trying to make a series of "bit vectors" of varying length and then Bluetooth wirelessly transmit them. This all in conformance with National Model RailRoad Association Digital Command Control standards.
Just getting started and am scared to death of the "NMRA Arduino Library"
Thanks to your kindness am starting to understand more about the void "keyword".