cheers ard
by that do you mean not to solely rely on the arduino setup is there xtra work to do ie,datasheet
this is my setup
void setup()
{
Serial.setInterruptPriority(2);
Serial.begin(115200);
Serial.flush();
SI.empty_serial_buffer(); //reads until buffer empty
this is the function out put on the serial monitor
Opening port
Port open
Choose from codes below
---------------------------------------
Code Description
X Exit without making selection
1 26 pin data recorder
2 To record pulse timing on a single pin
3 To record timing and count of a series
of pulses, on a single pin
this is the same function run a second time with further output
Choose from codes below
---------------------------------------
Code Description
X Exit without making selection
1 To use default data reco <-----stops here sometimes garbage, sometimes not
this is what should be printing
//options for initial configure setup
int configure_opt;
const int config_choices = 2;
constexpr int config_opt[config_choices] {1, 2};
String config_opt_msg[config_choices]
{
"To use default data recorder settings", //1
"To setup with new data recorder settings" //2 <------ should be printing here
};
//end configure setup
this is the function
bool SerInput::check_for_int_input(int &dest, const int src[], const int src_size, String msg[])
{
bool ret = false;
bool print_once = true;
bool reading = true;
bool input_match = false;
int number_in = 0;
char input[10];
int input_idx = 0;
while(input_match == false)
{
//header print
if(print_once == true)
{
print_single_input_header();
print_exit_option();
for(int i = 0; i < src_size; i++)
{
//long buff_sz = Serial.availableForWrite();
//Serial.println(buff_sz);
//long tl = msg[i].length();
//Serial.println(tl);
Serial.print( src[i] ); Serial.print('\t'); Serial.println( msg[i] );
//buff_sz = Serial.availableForWrite();
//Serial.println(buff_sz);
//printf(" %s \n", "my test message");
Serial.flush();
}
print_once = false;
//delay(2500);
}
//read input
while(reading == true)
{
if(Serial.available() > 0)
{
input[input_idx] = Serial.read();
if(input[input_idx] == 'X')
{
input_match = true;
reading = false;
Serial.println("Exiting ");
break;
}
if(input[input_idx] == '\n')
{
reading = false;
break;
}
if( ++input_idx > 10 )
{
reading = false;
empty_serial_buffer();
break;
}
}
}
number_in = atoi(input);
//validate against array
for(int k = 0; k < src_size; k++)
{
if(number_in == src[k])
{
input_match = true;
ret = true;
dest = number_in;
Serial.println("Confirmed: ");
Serial.print("\t");
Serial.println(msg[k]);
break;
}
}
if(input_match == false)
{
reading = true;
input_idx = 0;
memset( input, 0, sizeof(input) );
Serial.println("Incorrect entry, choose one of the codes above");
Serial.flush();
}
}
Serial.println(header_seperator);
Serial.println();
Serial.flush();
return ret;
}